-
Notifications
You must be signed in to change notification settings - Fork 7
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
world.cfg has UTF-8 Encoded Characters causing compile errors #11
Comments
On 22.08.2016 02:40, gpratt3151 wrote:
This patch should work instead: diff --git a/Cfg.py b/Cfg.py
Alternately you could "export LC_ALL=en_US.UTF-8" in the shell. That'd -- Matthias Urlichs |
Ok. Perhaps we should put that in the README.md or HOWTO.md file? It took me a few hours to figure it out as this appears to be a very common python3 issue and doesn't throw a very good error pointing to the file in error. And, even if it did reference the file, trying to figure out a character position can be difficult. Do you prefer pull requests? |
Pull requests are good. |
Ok. I'll probably have some time to work on it this weekend and I'll shoot you a pull request on the documentation if I see anything. Appreciate the quick response. |
First of all, thank you for the project!
It looks like the file was opened in an editor that converted '...' and 'uf' to UTF-8 (like MS Word does with auto correct).
Here's the diff. I also attached a fixed version of world.cfg.
world.cfg.txt
Here is the error:
Traceback (most recent call last):
File "./cfg", line 498, in
main(*sys.argv[1:])
File "./cfg", line 67, in main
s = Cfg(cfg_name)
File "/home/gpratt/owslave/Cfg.py", line 64, in init
self.data = yaml.load(fd)
File "/usr/lib/python3/dist-packages/yaml/init.py", line 70, in load
loader = Loader(stream)
File "/usr/lib/python3/dist-packages/yaml/loader.py", line 34, in init
Reader.init(self, stream)
File "/usr/lib/python3/dist-packages/yaml/reader.py", line 85, in init
self.determine_encoding()
File "/usr/lib/python3/dist-packages/yaml/reader.py", line 124, in determine_encoding
self.update_raw()
File "/usr/lib/python3/dist-packages/yaml/reader.py", line 178, in update_raw
data = self.stream.read(size)
File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 5525: ordinal not in range(128)
Hope this helps.
-Greg
The text was updated successfully, but these errors were encountered: