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

Conversation

fan-ziqi
Copy link

@fan-ziqi fan-ziqi commented Jul 6, 2024

When there are non-UTF-8 characters in git diff, the following error will be reported:

Traceback (most recent call last):
  File "/home/ubuntu/workspaces/IsaacLab/source/standalone/workflows/rsl_rl/train.py", line 135, in <module>
    main()
  File "/home/ubuntu/workspaces/IsaacLab/source/standalone/workflows/rsl_rl/train.py", line 127, in main
    runner.learn(num_learning_iterations=agent_cfg.max_iterations, init_at_random_ep_len=True)
  File "/home/ubuntu/anaconda3/envs/isaaclab/lib/python3.10/site-packages/rsl_rl/runners/on_policy_runner.py", line 160, in learn
    git_file_paths = store_code_state(self.log_dir, self.git_status_repos)
  File "/home/ubuntu/anaconda3/envs/isaaclab/lib/python3.10/site-packages/rsl_rl/utils/utils.py", line 85, in store_code_state
    f.write(content)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 1007-1025: ordinal not in range(128)

So need to add encoding="utf-8"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant