diff --git a/python-libs/poulpe_helper.py b/python-libs/poulpe_helper.py index d00bf0f38e5526b6af264db436226697dd008282_cHl0aG9uLWxpYnMvcG91bHBlX2hlbHBlci5weQ==..85d36c2cb7772cdee2ce4543d5fd57c4bf4a9d1a_cHl0aG9uLWxpYnMvcG91bHBlX2hlbHBlci5weQ== 100644 --- a/python-libs/poulpe_helper.py +++ b/python-libs/poulpe_helper.py @@ -39,5 +39,8 @@ def write_data(path, data): """write description data at <path>""" - with tempfile.NamedTemporaryFile(mode='w', delete=False) as f: + directory = os.path.dirname(path) + basename = os.path.basename(path) + tmp_path = os.path.join(directory, f".{basename}.tmp") + with open(tmp_path, "w") as f: toml.dump(data, f) @@ -43,5 +46,5 @@ toml.dump(data, f) - os.replace(f.name, path) + os.replace(tmp_path, path) def show(data, indent=''):