From a9b0a8a01d8431f5047e664806c733f4c2409afa Mon Sep 17 00:00:00 2001 From: Ivan Usov Date: Mon, 30 Nov 2020 17:30:57 +0100 Subject: [PATCH] Use temp dir for saving debug.xml for anatric --- pyzebra/app/panel_hdf_anatric.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyzebra/app/panel_hdf_anatric.py b/pyzebra/app/panel_hdf_anatric.py index 529bebe..cd06614 100644 --- a/pyzebra/app/panel_hdf_anatric.py +++ b/pyzebra/app/panel_hdf_anatric.py @@ -401,9 +401,11 @@ def create(): ) async def update_config(): - config.save_as("debug.xml") - with open("debug.xml") as f_config: - output_config.value = f_config.read() + with tempfile.TemporaryDirectory() as temp_dir: + temp_file = temp_dir + "/debug.xml" + config.save_as(temp_file) + with open(temp_file) as f_config: + output_config.value = f_config.read() doc.add_periodic_callback(update_config, 1000)