galactics / beyond

Flight Dynamic Library
MIT License
49 stars 8 forks source link

in the File "beyond\frames\iau1980.py" : Line 22 #33

Closed wangxiaochuTHU closed 3 years ago

wangxiaochuTHU commented 3 years ago

The usage of this package would cause a fatal error for those systems using "utf-8" characters. After testing, I found beyond\frames\iau1980.py : Line 22 might be the reason. I think this line

with filepath.open as fhd:

should be fixed to

with filepath.open(encoding="utf-8") as fhd:

What's your opinion?

galactics commented 3 years ago

I plainly agree with you. I thought that UTF-8 was standard on every modern platform (i.e. recent enough to receive python 3.6+), but it was an obvious misconception, as anyone can configure the default encoding of their choice.

I committed modifications to this behavior in this function, as well as in all the open calls that deal with known files (the ones that are included in the library are all either UTF-8 or ASCII). For other files, I provided a way to specify the encoding.

Do not hesitate to comment further if you think this approach is not ideal.

Thank you for your feedback