Skip to content

Commit

Permalink
fix: made utf-8 encoding for write_text
Browse files Browse the repository at this point in the history
  • Loading branch information
Poiuy7312 committed Nov 3, 2023
1 parent 89318c5 commit 9027877
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chasten/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def write_dict_results(
# using indentation to ensure that JSON file is readable
results_path_with_file = results_path / complete_results_file_name
# use the built-in method from pathlib Path to write the JSON contents
results_path_with_file.write_text(results_json)
results_path_with_file.write_text(results_json, "utf-8")
# return the name of the file that contains the JSON dictionary contents
return complete_results_file_name

Expand Down Expand Up @@ -293,7 +293,7 @@ def get_json_results(json_paths: List[Path]) -> List[Dict[Any, Any]]:
# iterate through each of the provided paths to a JSON file
for json_path in json_paths:
# turn the contents of the current JSON file into a dictionary
json_dict = json.loads(json_path.read_text())
json_dict = json.loads(json_path.read_text("utf-8"))
# add the current dictionary to the list of dictionaries
json_dicts_list.append(json_dict)
# return the list of JSON dictionaries
Expand Down

0 comments on commit 9027877

Please sign in to comment.