-
Notifications
You must be signed in to change notification settings - Fork 3k
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
tools: Let unicode error messages through #6154
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unicode
does not exist in Python 3. Please import it from six
or do a try: ... except ImportError:
like utils.py
Ah, it looks like |
@geky |
It seems to behave as $ python2 -c 'from builtins import str; print(str(u"\U0001f60b"))'
$ python3 -c 'from builtins import str; print(str(u"\U0001f60b"))'
http://python-future.org/reference.html#module-future.builtins |
@geky That website is quite confusing: it seems to indicate that it's describing the |
Either way, Sure you can use that import. It seems to work. Just take a look at the rest of the file to verify that you're not breaking any other |
Some toolchains (GCC) may emit error messages with unicode symbols based on the your localization settings. Instead of being passed to the user as is, the unicode causes an exception.
4c1634b
to
0bc386a
Compare
I don't know why it is and it is confusing, but the I tested most of the other |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
/morph build |
Build : SUCCESSBuild number : 1207 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 878 |
Test : SUCCESSBuild number : 1006 |
Also reliant on #5848 for 5.8 |
Some toolchains (GCC) may emit error messages with unicode symbols based on the your localization settings. Instead of being passed to the user as is, the unicode causes an exception.
I'm not sure exactly what the correct fix is regarding python2+3 compat, but changing
str
tounicode
seems to work on my setup (x86_64-linux-gnu-gcc 5.4.0 + python 2.7.12 + mbed-os-5c7cd1f + LANG=en_US.UTF-8)cc @theotherjimmy