Skip to content

Avoid UnicodeDecodeError in setup.py - #365

Merged
toslunar merged 1 commit into
chainer:masterfrom
muupan:fix-unicode-error
Dec 9, 2018
Merged

Avoid UnicodeDecodeError in setup.py#365
toslunar merged 1 commit into
chainer:masterfrom
muupan:fix-unicode-error

Conversation

@muupan

@muupan muupan commented Dec 9, 2018

Copy link
Copy Markdown
Member

pip install -e . raises UnicodeDecodeError when LC_CTYPE is POSIX.

      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "/home/user/setup.py", line 31, in <module>
          long_description=open('README.md').read(),
        File "/usr/lib/python3.5/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 2004: ordinal not in range(128)

To reproduce this error, LC_ALL=POSIX pip install -e ..

This PR fixes this error by specifying the encoding when reading README.md.

@toslunar toslunar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@toslunar
toslunar merged commit afddd83 into chainer:master Dec 9, 2018
@muupan muupan added this to the v0.6 milestone Feb 26, 2019
@muupan muupan added the bug label Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants