osvenskan / posix_ipc

Other
135 stars 24 forks source link

pip install error with version 1.1.0 on Docker #40

Closed kshepitzki closed 1 year ago

kshepitzki commented 1 year ago
#11 4.562   Downloading https://files.pythonhosted.org/packages/41/72/90b6702782921c0e3e0b10a66f2a47d8cfaf9c2255d763ab45cc8cea25eb/posix_ipc-1.1.0.tar.gz (94kB)
#11 4.686     Complete output from command python setup.py egg_info:
#11 4.686     Traceback (most recent call last):
#11 4.686       File "<string>", line 1, in <module>
#11 4.686       File "/tmp/pip-build-wwawuefb/posix-ipc/setup.py", line 20, in <module>
#11 4.686         long_description = f.read().strip()
#11 4.686       File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
#11 4.686         return codecs.ascii_decode(input, self.errors)[0]
#11 4.686     UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 300: ordinal not in range(128)
#11 4.686
#11 4.686     ----------------------------------------
#11 4.694 Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-wwawuefb/posix-ipc/
osvenskan commented 1 year ago

Thanks for the bug report! This is something I need to fix.

The exception occurs because setup.py calls open() without specifying an encoding. In that case, open() calls locale.getencoding() to decide which encoding to use. (https://docs.python.org/3.11/library/functions.html#open). In your case, that's set to ascii. Apparently it is utf-8 everywhere I ran my tests.

You can work around this problem by changing your locale to utf-8 although I can understand why you might not want to.

FYI posix_ipc no longer supports Python 3.6, so you might run into other problems trying to use posix_ipc with this version of Python. This bug that you reported isn't specific to Python 3.6, though.

osvenskan commented 1 year ago

This is fixed in version 1.1.1.