Skip to content

Conversation

@fan-ziqi
Copy link
Contributor

@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"

@Mayankm96 Mayankm96 changed the title fix: error caused by non UTF-8 characters in git diff Fixes error caused by non UTF-8 characters in git diff Feb 7, 2025
@Mayankm96 Mayankm96 merged commit 90b3ef1 into leggedrobotics:master Feb 7, 2025
zxu-rai pushed a commit to zxu-rai/rsl_rl that referenced this pull request Sep 19, 2025
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.

2 participants