def _create_json_metadata_str(file_name):
type_metadata_json_file = file_name + ".json"
debug(type_metadata_json_file)
- json_file = open(type_metadata_json_file)
+ json_file = open(type_metadata_json_file, encoding='utf-8')
debug("before load json")
json_data = json.load(json_file, strict=False)
debug(path)
current_json_file = file_dir + element_name + "/" + element_name + ".json"
- json_file = open(current_json_file)
+ json_file = open(current_json_file, encoding='utf-8')
debug("before load json")
json_data = json.load(json_file, strict=False)
def __read_model_payload_as_string(self, model, action_type) -> str:
base_path = self.__get_base_action_path(action_type)
model_payload_path = base_path / model / "payload.json"
- json_file = open(model_payload_path)
+ json_file = open(model_payload_path, encoding='utf-8')
json_data = json.load(json_file, strict=False)
return json.dumps(json_data)
path = tosca_path / "types.json"
if not os.path.isfile(path):
return []
- json_file = open(path)
+ json_file = open(path, encoding='utf-8')
return json.load(json_file)
def __read_model_payload(self, model, action_type) -> dict:
base_path = self.__get_base_action_path(action_type)
model_payload_path = base_path / model / "payload.json"
- json_file = open(model_payload_path)
+ json_file = open(model_payload_path, encoding='utf-8')
return json.load(json_file, strict=False)
def __get_base_action_path(self, action_type) -> Path:
def load_files(self, files):
for file in files:
- with open(file, 'r') as stream:
+ with open(file, 'r', encoding='utf-8') as stream:
_types = json.load(stream)
for type_key, type_value in _types.items():
self.types_list[type_key] = type_value