mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Use byte-mode for writing binary file
This commit is contained in:
@ -40,7 +40,7 @@ def cli(dev):
|
|||||||
|
|
||||||
to_develop = dev or not all(c.isdigit() for c in __version__ if c != ".")
|
to_develop = dev or not all(c.isdigit() for c in __version__ if c != ".")
|
||||||
cmds = (
|
cmds = (
|
||||||
["pip", "install", "--upgrade", get_pip_package(to_develop)],
|
["pip", "install", "--upgrade", download_dist_package(to_develop)],
|
||||||
["platformio", "--version"],
|
["platformio", "--version"],
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ WARNING! Don't use `sudo` for the rest PlatformIO commands.
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def get_pip_package(to_develop):
|
def download_dist_package(to_develop):
|
||||||
if not to_develop:
|
if not to_develop:
|
||||||
return "platformio"
|
return "platformio"
|
||||||
dl_url = "https://github.com/platformio/platformio-core/archive/develop.zip"
|
dl_url = "https://github.com/platformio/platformio-core/archive/develop.zip"
|
||||||
@ -103,7 +103,7 @@ def get_pip_package(to_develop):
|
|||||||
os.makedirs(cache_dir)
|
os.makedirs(cache_dir)
|
||||||
pkg_name = os.path.join(cache_dir, "piocoredevelop.zip")
|
pkg_name = os.path.join(cache_dir, "piocoredevelop.zip")
|
||||||
try:
|
try:
|
||||||
with open(pkg_name, "w", encoding="utf8") as fp:
|
with open(pkg_name, "wb") as fp:
|
||||||
r = exec_command(
|
r = exec_command(
|
||||||
["curl", "-fsSL", dl_url], stdout=fp, universal_newlines=True
|
["curl", "-fsSL", dl_url], stdout=fp, universal_newlines=True
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user