Noticed a small issue when trying to install this from a source distribution on an system where the locale is set to POSIX and python version is 3.6 (this was the situation we had on a Jenkins build box we were using this project on)
[test@localhost requests_pkcs12]$ export LANG=POSIX
[test@localhost requests_pkcs12]$ export LC_ALL=POSIX
[test@localhost requests_pkcs12]$ locale
LANG=POSIX
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=POSIX
[test@localhost requests_pkcs12]$ pip3 install .
Processing /var/tmp/requests_pkcs12
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-k4kckmm2-build/setup.py", line 6, in <module>
long_description=open('README.rst').read(),
File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2244: ordinal not in range(128)
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-k4kckmm2-build/
We figured out this is due to the open() function call in setup.py not being explicit on the encoding (uses the system encoding returned locale.getpreferredencoding())
In our case the simple fix was to run this before the build:
Noticed a small issue when trying to install this from a source distribution on an system where the locale is set to POSIX and python version is 3.6 (this was the situation we had on a Jenkins build box we were using this project on)
We figured out this is due to the open() function call in setup.py not being explicit on the encoding (uses the system encoding returned locale.getpreferredencoding())
In our case the simple fix was to run this before the build:
I have also done a PR that makes sure the README.rst can be decoded correctly by setup.py regardless of the system locale. https://github.com/m-click/requests_pkcs12/pull/18https://github.com/m-click/requests_pkcs12/pull/18