Commit f194f8c2 authored by rgaudin's avatar rgaudin
Browse files

Fixed #254: on windows, tempfile needs to be created with delete=False to be used via its name

parent 350e8956
2.0-rc4
* Fixed clean cache regression
* Fixed PermissionError on QEMU phase One
* Safer JSON import
2.0-rc13
* Updated Wikifundi language packs (2018-10-24)
* Fixed latex in WikiFundi
......
......@@ -191,7 +191,7 @@ def run_phase_one(machine, extra_vars, secret_keys, logo=None, favicon=None, css
# save YAML catalogs into local files inside VM for use by ideascube
for index, catalog in enumerate(CATALOGS):
with tempfile.NamedTemporaryFile(suffix=".yml") as fd:
with tempfile.NamedTemporaryFile(suffix=".yml", delete=False) as fd:
yaml.safe_dump(
get_catalogs(machine._logger)[index],
fd,
......@@ -200,6 +200,7 @@ def run_phase_one(machine, extra_vars, secret_keys, logo=None, favicon=None, css
encoding="utf-8",
)
machine.put_file(fd.name, catalog["local_url"].replace("file://", ""))
os.unlink(fd.name)
run(machine, tags, extra_vars, secret_keys)
......
......@@ -174,7 +174,7 @@ class EtcherWriterThread(threading.Thread):
# on macOS, GUI sudo captures stdout so we use a log file
log_to_file = not from_cli and sys.platform == "darwin"
if log_to_file:
log_file = tempfile.NamedTemporaryFile(suffix=".log")
log_file = tempfile.NamedTemporaryFile(suffix=".log", delete=False)
cmd = [
os.path.join(data.data_dir, "etcher-cli", "etcher"),
......@@ -215,6 +215,7 @@ class EtcherWriterThread(threading.Thread):
if log_to_file:
log_file.close()
os.unlink(log_file)
try:
logger.std(". has process exited?")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment