Skip to content
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

UnicodeDecodeError? #53

Closed
jacobwilliams opened this issue May 3, 2015 · 8 comments
Closed

UnicodeDecodeError? #53

jacobwilliams opened this issue May 3, 2015 · 8 comments

Comments

@jacobwilliams
Copy link

I'm seeing some sort of bug maybe. See below. Interestingly, if I run FoBiS again, the error goes away.

Compiling src/json_module.F90 serially
Traceback (most recent call last):
  File "/Users/anaconda/bin/FoBiS.py", line 5, in <module>
    main()
  File "/Users/anaconda/lib/python3.4/site-packages/fobis/fobis.py", line 14, in main
    __config__.run_fobis()
  File "/Users/anaconda/lib/python3.4/site-packages/fobis/config.py", line 638, in run_fobis
    self._build()
  File "/Users/anaconda/lib/python3.4/site-packages/fobis/config.py", line 536, in _build
    builder.build(file_to_build=pfile, output=self.cliargs.output, nomodlibs=nomodlibs, mklib=self.cliargs.mklib, verbose=self.cliargs.verbose, log=self.cliargs.log)
  File "/Users/anaconda/lib/python3.4/site-packages/fobis/Builder.py", line 526, in build
    self._compile(file_to_build=file_to_build, verbose=verbose, log=log)
  File "/Users/anaconda/lib/python3.4/site-packages/fobis/Builder.py", line 462, in _compile
    result = syswork(cmd)
  File "/Users/anaconda/lib/python3.4/site-packages/fobis/utils.py", line 27, in syswork
    output = output.decode("ascii")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 97: ordinal not in range(128)
@szaghi
Copy link
Owner

szaghi commented May 4, 2015

Hi Jacob, It is due to byte string "nightmare" of Python (I think). Can you give me a minimal example that raises the bug? Anyhow, I cannot fix it before oneweek... my first daugther is coming :-) !!

@jacobwilliams
Copy link
Author

Congrats! Make sure you start teaching her Fortran early! I'll post the minimal example later.

@jacobwilliams
Copy link
Author

Some sort of non-printing control characters got into my source file somehow. When I deleted them the problem goes away. Maybe it is not a big deal.

@szaghi
Copy link
Owner

szaghi commented May 10, 2015

Dear Jacob, thank you for the example. The next week (when my daugther come at home!) I will try to see the exotic characters raising the error. Probably, your Visual Studio is the "killer" :-) with vim you will have the control :-)

See you soon, I hope.

@jacobwilliams
Copy link
Author

OK, I take back what I said. I'm seeing this error again, even though (I think) I have no unusual characters in the file. See the "refactor" branch here (commit 1272a40784). When I run the build.sh script (which is calling FoBiS) I see this error. I'm using Python 3.4.2.

@Tobychev
Copy link
Contributor

I remember having something similar happen to me, but I don't recall the fix. If you just look up what that unicode address is you learn that its RIGHT SINGLE QUOTATION MARK, hardly exotic.

This reminds me somewhat of #47 that I reported, there gfortran gave error messages with utf8 characters, and FoBiS didn't like it at all.

@jacobwilliams
Copy link
Author

Yes, it seems to have something to do with the error or warning messages emitted by gfortran. When I fixed the error in the code, the problem goes away (the commit after the one I referenced above).

@szaghi szaghi added the ready label Jun 8, 2015
@szaghi szaghi closed this as completed Aug 26, 2015
@szaghi szaghi removed the ready label Aug 26, 2015
@zbeekman
Copy link
Contributor

zbeekman commented Sep 1, 2015

Has this been fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants