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

Issue #41 resolved
Jakub Wilk
created an issue

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

$ python3 build
Traceback (most recent call last):
  File "", line 27, in <module>
    ''' % (open('README.rst').read(), open('CHANGELOG').read())
  File "/usr/lib/python3.2/encodings/", 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/
    --- polib-1.0.2.orig/
    +++ polib-1.0.2/
    @@ -24,7 +24,7 @@ long_desc = '''
    -''' % (open('README.rst').read(), open('CHANGELOG').read())
    +''' % (open('README.rst', encoding='utf-8').read(), open('CHANGELOG', encoding='utf-8').read())
     if __name__ == '__main__':
  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