From 1c5dfe89876fd20d39b2764206983c8cb06ab3c3 Mon Sep 17 00:00:00 2001 From: Jackson Date: Fri, 27 Aug 2021 12:39:13 -0500 Subject: [PATCH] save paths as valid json --- src/classes/json_data.py | 2 +- src/classes/project_data.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classes/json_data.py b/src/classes/json_data.py index f71655613b..7671349b15 100644 --- a/src/classes/json_data.py +++ b/src/classes/json_data.py @@ -314,7 +314,7 @@ def replace_string_to_relative(self, match): # If the file is on different drive. Don't abbreviate the path. clean_path = orig_abs_path.replace("\\", "/") clean_path = json.dumps(clean_path, ensure_ascii=False) - return f"{key}: {clean_path}" + return f"\"{key}\": {clean_path}" # Remove file from abs path orig_abs_folder = os.path.dirname(orig_abs_path) diff --git a/src/classes/project_data.py b/src/classes/project_data.py index 244ea7b8ac..0b7157199b 100644 --- a/src/classes/project_data.py +++ b/src/classes/project_data.py @@ -647,7 +647,7 @@ def read_legacy_project_file(self, file_path): # Increment track counter track_counter += 1 - except Exception: + except Exception as ex: # Error parsing legacy contents msg = "Failed to load legacy project file %(path)s" % {"path": file_path} log.error(msg, exc_info=1)