matthew-brett / delocate

Find and copy needed dynamic libraries into python wheels
BSD 2-Clause "Simplified" License
262 stars 59 forks source link

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 9794: ordinal not in range(128) #80

Closed haberman closed 3 years ago

haberman commented 3 years ago

I am seeing this error when trying to install delocate 0.8.1:

+ /Volumes/BuildData/tmpfs/src/github/protobuf/venv/bin/pip install delocate
Collecting delocate
  Using cached delocate-0.8.1.tar.gz (91 kB)
    ERROR: Command errored out with exit status 1:
     command: /Volumes/BuildData/tmpfs/src/github/protobuf/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wv/_5q8c8j155g873yylt68nd4c0000gn/T/pip-install-xix4nvsn/delocate/setup.py'"'"'; __file__='"'"'/private/var/folders/wv/_5q8c8j155g873yylt68nd4c0000gn/T/pip-install-xix4nvsn/delocate/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 /private/var/folders/wv/_5q8c8j155g873yylt68nd4c0000gn/T/pip-pip-egg-info-ekncmlka
         cwd: /private/var/folders/wv/_5q8c8j155g873yylt68nd4c0000gn/T/pip-install-xix4nvsn/delocate/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/wv/_5q8c8j155g873yylt68nd4c0000gn/T/pip-install-xix4nvsn/delocate/setup.py", line 70, in <module>
        long_description=open('README.rst', 'rt').read(),
      File "/Library/Frameworks/Python.framework/Versions/3.6/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 0xe2 in position 9794: 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.

This is occurring in the middle of a pipeline that builds distribution artifacts for our code. This is on macOS, but at the moment I don't have more info on what version of Python or an exact repro.

matthew-brett commented 3 years ago

Hmm - I guess, for some reason, your system's default encoding is 'ascii', and therefore open ... read breaks when trying to read delocate's README, because it has non-ASCII characters. Can you change the system's default encoding so - say - UTF8?