Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: error caused by non UTF-8 characters in git diff #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ Please keep the lists sorted alphabetically.
* Matthijs van der Boon
* Mayank Mittal
* Zhang Chong
* Ziqi Fan
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