You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UnicodeDecodeError from setup.py with python3.6 and LANG=C #84
Thanks for opening this issue. It seem a duplicate of #60 . I was wondering, could you share the Dockerfile you used? I'd like to reproduce the problem myself.
@OrangeTux i can reproduce this by running the command in the original issue.
$ docker run --rm python:3.6 env LANG=C pip install --no-binary :all: uModBus==1.0.3
Collecting uModBus==1.0.3
Downloading https://files.pythonhosted.org/packages/eb/1c/852af30263b6fd44e160951d35f70f26a4c7b1f15458c174402c04d0753b/uModbus-1.0.3.tar.gz
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "<string>", line 1, in<module>
File "/tmp/pip-install-qagdmmru/uModBus/setup.py", line 12, in<module>
long_description = open(os.path.join(cwd, 'README.rst'), 'r').read()
File "/usr/local/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 547: ordinal not in range(128) ----------------------------------------ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-qagdmmru/uModBus/WARNING: You are using pip version 19.1.1, however version 20.0.2 is available.You should consider upgrading via the 'pip install --upgrade pip' command.
When you remove the env LANG=C part from the command the build works.
Activity
OrangeTux commentedon Feb 5, 2020
Thanks for opening this issue. It seem a duplicate of #60 . I was wondering, could you share the Dockerfile you used? I'd like to reproduce the problem myself.
jaapz commentedon Feb 8, 2020
@OrangeTux i can reproduce this by running the command in the original issue.
$ docker run --rm python:3.6 env LANG=C pip install --no-binary :all: uModBus==1.0.3 Collecting uModBus==1.0.3 Downloading https://files.pythonhosted.org/packages/eb/1c/852af30263b6fd44e160951d35f70f26a4c7b1f15458c174402c04d0753b/uModbus-1.0.3.tar.gz ERROR: Complete output from command python setup.py egg_info: ERROR: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-qagdmmru/uModBus/setup.py", line 12, in <module> long_description = open(os.path.join(cwd, 'README.rst'), 'r').read() File "/usr/local/lib/python3.6/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 547: ordinal not in range(128) ---------------------------------------- ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-qagdmmru/uModBus/ WARNING: You are using pip version 19.1.1, however version 20.0.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command.When you remove the
env LANG=Cpart from the command the build works.A quick google gives me this: https://stackoverflow.com/questions/39206705/python-3-throws-unicodeencodeerror-with-environment-variable-lang-c
tldr: setting LANG=C tells python to use ASCII as default encoding. However the README.rst contains unicode characters, so it breaks.
I think setting
encoding="utf-8"in theopencall should fix this:I haven't tested this though.
jaapz commentedon Feb 8, 2020
Ah I see that's also what you proposed in the PR 🙃