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)
When there are non-UTF-8 characters in git diff, the following error will be reported:
So need to add
encoding="utf-8"