-
Notifications
You must be signed in to change notification settings - Fork 97
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
Explicitly decode appdirs.py as UTF-8 #152
Conversation
I'm seeing this problem too. |
here is a reproduction with python3.6 on linux: $ LANG=C python3 -m pip wheel .
Processing /tmp/appdirs
ERROR: Command errored out with exit status 1:
command: /tmp/appdirs/venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-aidjyogf/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-aidjyogf/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-iozfgf3t
cwd: /tmp/pip-req-build-aidjyogf/
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-req-build-aidjyogf/setup.py", line 19, in <module>
for line in read("appdirs.py").splitlines():
File "/tmp/pip-req-build-aidjyogf/setup.py", line 13, in read
out = "\n" + inf.read().replace("\r\n", "\n")
File "/usr/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 0xc8 in position 107: ordinal not in range(128)
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.2.1; however, version 20.2.3 is available.
You should consider upgrading via the '/tmp/appdirs/venv/bin/python3 -m pip install --upgrade pip' command. |
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.
The |
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.
🙏
Thanks for the submission. Cheers. |
Reading appdirs.py without explicitly requesting UTF-8 decoding results in the build process to fail for Python 3.6. See ActiveState/appdirs#152 for the upstream fix.
Reading appdirs.py without explicitly requesting UTF-8 decoding results in the build process to fail for Python 3.6. See ActiveState/appdirs#152 for the upstream fix.
When setup.py reads appdirs.py without an encoding defined, it can sometimes fail having guessed the wrong encoding. For example:
Whereas the builtin
open
does not accept theencoding
argument until 3.0,io.open
supportsencoding
under all versions supported by appdirs.