-
Notifications
You must be signed in to change notification settings - Fork 35
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
Problmen with utf-8 #47
Comments
Hi Thomas, be careful, maybe you are not using the last version (the lines numbers seem to be different with the last version on github, that, in any case, is older than the one I am now working on... I hope to push the new version later today). Anyhow, your issue is interesting because I have (erroneously) assumed to have already fixed... at least in my own version. The new syswork function I am using is def syswork(cmd):
"""
Function for executing system command 'cmd': for compiling and linking files.
"""
error = 0
try:
output = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as err:
error = err.returncode
output = err.output.encode("ascii", errors='ignore')
return [error, output] This should fix any ascii/unicod string issues... For checking what goes wrong (a sort of debugging mode of FoBiS.py) you have the Finally, be careful to pass quoted string as argument: argparse is bugged ... https://github.com/szaghi/FoBiS/wiki/Getting-Started#a-note-on-quoted-string-arguments Later today I hope to give you a more precise response. |
I last pulled on saturday, so I have what is on github right now; are the line numbers much different, or just off by one? As mentioned I put in a print statement by hand to see what the error text was before FoBiS died, so that's probably why its different. I haven't put any options in quotation marks, I think they come from gfortran directly. |
Sure you are right, Anyhow, my local version is now different from your, thus it is complicated for me to check this issue. I think if you substitute your syswork with the one I posted above and you use See you later. |
Hi Tomas, I have just pushed the new version (on both Github and PyPi). I close this Issue, but you reopen it if the issue persists. See you soon. |
Hello Stefano,
sometimes when I accidentally give a incorrect flag to the compiler, fobis will crash with a message ending like this:
File "FoBiS/src/main/python/fobis/Builder.py", line 457, in _compile
result = syswork(cmd)
File "FoBiS/src/main/python/fobis/utils.py", line 27, in syswork
return [error, str(output.decode("utf-8"))]
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2018' in position 50: ordinal not in range(128)
Today I put a print statement in utils.syswork to see what the compiler was returning and saw:
gfortran: error: unrecognized command line option ‘-fdefault-integer-4’
So these ‘marks’ that gfortran sets around the offending flag crashes FoBiS and I never get to know what my error was :(
The text was updated successfully, but these errors were encountered: