Issue #41 resolved

LC_ALL=C + python3 -> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3

Jakub Wilk
created an issue

If you run setup.py under C locale with Python 3, it fails with UnicodeDecodeError:

$ python3 setup.py build
Traceback (most recent call last):
  File "setup.py", line 27, in <module>
    ''' % (open('README.rst').read(), open('CHANGELOG').read())
  File "/usr/lib/python3.2/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 648: ordinal not in range(128)

Comments (6)

  1. Kyrill Detinov

    It works with the patch:

    Index: polib-1.0.2/setup.py
    ===================================================================
    --- polib-1.0.2.orig/setup.py
    +++ polib-1.0.2/setup.py
    @@ -24,7 +24,7 @@ long_desc = '''
    
     %s
    
    -''' % (open('README.rst').read(), open('CHANGELOG').read())
    +''' % (open('README.rst', encoding='utf-8').read(), open('CHANGELOG', encoding='utf-8').read())
    
     if __name__ == '__main__':
         setup(
    
  2. Jakub Wilk reporter

    encoding='utf-8' does the trick for Python 3.X, but it breaks Python 2.X suport: TypeError: 'encoding' is an invalid keyword argument for this function

  3. Log in to comment