Issue #144 resolved

Installation failed to run on python 3.x when command line encoding is not utf8 and readme_file contains non-ASCII characters

Felix Yan
created an issue

readme_file.read() will try to use 'ascii' to decode, and thus failed. For example, set LANG=C and get this:

Traceback (most recent call last):
  File "setup.py", line 93, in <module>
    long_description = readme_file.read() + '\n' + changes_file.read()
  File "/usr/lib/python3.3/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 7330: ordinal not in range(128)

I filed a patch for the same problem to python-Levenshtein, hope it helps: https://github.com/ztane/python-Levenshtein/pull/2

Comments (5)

  1. Felix Yan reporter

    Note: The easiest workaround I'm currently using is:

    sed -i -e "s/open('\(README\|CHANGES\|CHANGES (links)\).txt')/open('\1.txt', encoding='utf8')/" setup.py
    
  2. Log in to comment