Skip to content

Commit

Permalink
fix: Changed encoding to utf-8 if default fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Poiuy7312 committed Sep 29, 2023
1 parent 2dab4d1 commit 1373628
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion chasten/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ def write_chasten_results(
results_path_with_file = results_path / complete_results_file_name
results_json = results_content.model_dump_json(indent=2)
# use the built-in method with pathlib Path to write the JSON contents
results_path_with_file.write_text(results_json)
try:
results_path_with_file.write_text(results_json)
except: # noqa: E722
results_path_with_file.write_text(results_json,"utf-8")

# return the name of the created file for diagnostic purposes
return complete_results_file_name
# saving was not enabled and thus this function cannot
Expand Down

0 comments on commit 1373628

Please sign in to comment.