Skip to content

Commit

Permalink
fix: error caused by non UTF-8 characters in git diff
Browse files Browse the repository at this point in the history
  • Loading branch information
fan-ziqi committed Jul 6, 2024
1 parent a1d25d1 commit 7e1944d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rsl_rl/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def store_code_state(logdir, repositories) -> list:
continue
# write the diff file
print(f"Storing git diff for '{repo_name}' in: {diff_file_name}")
with open(diff_file_name, "x") as f:
with open(diff_file_name, "x", encoding="utf-8") as f:
content = f"--- git status ---\n{repo.git.status()} \n\n\n--- git diff ---\n{repo.git.diff(t)}"
f.write(content)
# add the file path to the list of files to be uploaded
Expand Down

0 comments on commit 7e1944d

Please sign in to comment.