From f594c860de09415d4c43a3dff3aa5d60f4209906 Mon Sep 17 00:00:00 2001 From: "kunal.sontakke" <kunal.sontakke@nitorinfotech.com> Date: Wed, 18 Sep 2024 19:09:13 +0530 Subject: [PATCH] changes done in all files -test scripts -Rest client (added Auto_save) -changes in save_json_to_file --- API_Requests/Lib/File_Operations.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/API_Requests/Lib/File_Operations.py b/API_Requests/Lib/File_Operations.py index d0e8854..c91d7c1 100644 --- a/API_Requests/Lib/File_Operations.py +++ b/API_Requests/Lib/File_Operations.py @@ -75,9 +75,13 @@ def read_json_from_file(file_path,request_dir='API_Requests/Data/Request_Body'): """ try: full_path = os.path.join(request_dir,file_path) + + # Normalize the path for logging + full_path_normalized = full_path.replace(os.sep, '/') + with open(full_path, 'r') as file: data = json.load(file) - logger.info(f"JSON data successfully read from {full_path}") + logger.info(f"JSON data successfully read from {full_path_normalized}") return data except json.JSONDecodeError as e: logger.error(f"Failed to decode JSON: {e}")