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

Fix error when trying to print unicode strings #128

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pointhi
Copy link
Contributor

@pointhi pointhi commented Feb 16, 2017

Sadly, python has quite a bunch of handling issues regarding utf-8

I solved the error in this specific way, because it's possible log_error is called with some object where we want to have the string representation, and not directly using str or unicode.

@dougxc
Copy link
Member

dougxc commented Feb 16, 2017

What error did you hit that this fix addresses?

@pointhi
Copy link
Contributor Author

pointhi commented Mar 31, 2017

Well, It required some time before the error reoccur:

Checkstyle ends with 8 errors.
Traceback (most recent call last):
  File "/home/thomas/JKU/sulong-dev/mx/mx.py", line 15048, in <module>
    main()
  File "/home/thomas/JKU/sulong-dev/mx/mx.py", line 15032, in main
    retcode = c(command_args)
  File "/home/thomas/JKU/java-llvm-ir-builder-dev/sulong/mx.sulong/mx_sulong.py", line 373, in runChecks
    optionalRetValue = command(vmArgs)
  File "/home/thomas/JKU/sulong-dev/mx/mx.py", line 10802, in checkstyle
    map(log_error, errors)
  File "/home/thomas/JKU/sulong-dev/mx/mx.py", line 9533, in log_error
    print >> sys.stderr, colorize(str(msg), stream=sys.stderr)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 185: ordinal not in range(128)

@dougxc dougxc assigned dougxc and sanzinger and unassigned dougxc Apr 2, 2017
zapster pushed a commit to zapster/mx that referenced this pull request Jul 1, 2017
* commit 'e49066b704dd96a91a029c6e6a1181411004508c':
  Fix intellijinit error when there is no sourcePath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants