timduly4 / pyglow

Upper atmosphere climatological models in Python
MIT License
104 stars 57 forks source link

archlinux gfortran decode #64

Closed htyeim closed 5 years ago

htyeim commented 5 years ago

remove possible unicode errors in fortran code

timduly4 commented 5 years ago

@htyeim I had this issue compiling:

python remove_decode_errors.py
Traceback (most recent call last):
  File "remove_decode_errors.py", line 8, in <module>
    content = open(f,'r',errors='replace').read()
TypeError: 'errors' is an invalid keyword argument for this function
make[2]: *** [remove_decode_errors] Error 1
make[1]: *** [source] Error 2
make: *** [source] Error 2
bharding512 commented 5 years ago

@htyeim, Thank you so much. This solved my problem on python3. It's odd that some systems show this unicode error but some don't.

The reason @timduly4 couldn't compile this is perhaps because "open()" changed in python3 to allow the "errors" keyword argument. This means that, while this solution works for python3, it doesn't for python2, and thus can't be a solution for pyglow.

Is there a way to make this solution compatible with python2?

timduly4 commented 5 years ago

Building off this: https://github.com/timduly4/pyglow/pull/80

timduly4 commented 5 years ago

@htyeim Thanks for your help-- I've implemented your changes in https://github.com/timduly4/pyglow/pull/80