-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
Unicode issue : UnicodeEncodeError: 'ascii' codec can't encode character u'\u2018' in position 46133: ordinal not in range(128) #1369
Comments
Can you please post full stack trace and version information? |
Hi, Here is the data requested: tox --version3.13.2 imported from /usr/local/lib/python2.7/dist-packages/tox/init.pyc Below is the data printed for key and value, value contain a large message.
error seen is
Stack trace
|
If anyone is still hitting this issue, it's probably caused by an error messages emitted by pip during preparation of the testing environment (in my case, it was a failing In my particular case I was able to get to the actual error message by exporting |
its not a right idea to set complete environment en_US.UTF-8, what in case if we are using a different locales in another applications running on the same OS |
Sure, it's just a temporary workaround - one still needs to resolve the errors thrown (by pip or otherwise). But the gist is, as I understand it, that tox tries to convert the subprocess output to str(), which will be a problem on PY2 if the output contains Unicode characters, as str() still refers to an ASCII string. Maybe a false assumption, going barely by the traceback here, haven't looked at the source in depth. |
I'm running into the same issue; however setting |
Figured it out. You might also have to set export LC_ALL= en_US.UTF-8 |
This one works perfectly for me |
Getting below error when we run tox:
File "/usr/local/lib/python2.7/dist-packages/tox/reporter.py", line 74, in logline_if
message = str(msg) if key is None else "{}{}".format(key, msg)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2018' in position 46133: ordinal not in range(128)
The text was updated successfully, but these errors were encountered: