redacted / XKCD-password-generator

Generate secure multiword passwords/passphrases, inspired by XKCD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Package installation fails for python3

al3k opened this issue · comments

Collecting xkcdpass
Downloading https://files.pythonhosted.org/packages/2e/06/fad1571c78759c0e77ac9f689282297725800eb66e19e62c3e2413225e99/xkcdpass-1.17.0.tar.gz (2.1MB)
100% |################################| 2.1MB 4.5MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-kpp9rf3x/xkcdpass/setup.py", line 11, in
long_description=open('README.rst').read(),
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 0xc3 in position 6812: ordinal not in range(128)

Hey - I just tested installing the latest package using python3.6 pip and it completed without error.

My best guess is that one of the environment variables (LANG, LC_ALL, LC_CTYPE, etc) are set to something that forces ASCII, and the setup.py doesn't set an encoding for the open call. I can change the setup script to attempt to force UTF encoding, but I would be curious about the env variables I mentioned

Hey,
I am using official Ubuntu 18.04 docker for my tests.
Indeed, if I run locale , that's the output ...
LANG=
LANGUAGE=
LC_CTYPE="POSIX"

And running:
python -c "import sys; print(sys.stdout.encoding)"
ANSI_X3.4-1968

Python 3.6.7 (default, Oct 22 2018, 11:32:17)
Maybe you should consider to enforce some encoding, so installation won't fail

Definitely - it looks like the 1.17.0 was the first release that included non-ASCII characters in the README, which is causing the issue.

Could you test this for me: Change
long_description=open('README.rst').read(),
to
long_description=open('README.rst', encoding='utf-8').read(),
in setup.py, then try python setup.py install. That should enforce the encoding, and if it works I'll push a new version straight away.

I have tested your proposed change and it indeed solves the issue.
Thanks and sorry for the belated response.

Hey, I pushed a new version to pypi yesterday with the above fix included. Can you confirm it works on your machine as well?

I have tested and it works fine. Thanks !

Great! Thanks for letting me know