From 313f3e82862078319a400bb163e5980171d16b12 Mon Sep 17 00:00:00 2001 From: rockerBOO Date: Thu, 30 Mar 2023 12:08:04 -0400 Subject: [PATCH] Open dataset_config json file before load --- library/config_util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/config_util.py b/library/config_util.py index 97bbb4a8..3064117f 100644 --- a/library/config_util.py +++ b/library/config_util.py @@ -486,7 +486,8 @@ def load_user_config(file: str) -> dict: if file.name.lower().endswith('.json'): try: - config = json.load(file) + with open(file, 'r') as f: + config = json.load(f) except Exception: print(f"Error on parsing JSON config file. Please check the format. / JSON 形式の設定ファイルの読み込みに失敗しました。文法が正しいか確認してください。: {file}") raise