I've come across a python error similar to this while running genrules in my bazel setup.
The root cause of this error is that certain language environment variables are not set as expected, so files aren't being read with the correct encoding.
Setting
build --action_env="LANG=en_GB.UTF-8"
run --action_env="LANG=en_GB.UTF-8"
test --action_env="LANG=en_GB.UTF-8"
in my .bazelrc is a workaround, but feels somewhat hacky. What is the best way to configure bazel's language/locale settings for genrules?