Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup: open README.md with a specific encoding
With python3, the built-in open() function opens files in "text" mode by default (i.e. the f.read() method reads bytes and tries to decode them to unicode using the interpreter default encoding). Depending on the system locale, this default encoding may be 'ascii'. Which leads to the following error: ~$ python3 setup.py egg_info Traceback (most recent call last): File "setup.py", line 12, in <module> long_description = f.read() File "/usr/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 0xc3 in position 2587: ordinal not in range(128) The character at position 2587 is 'ô' (from Fantômas) and is utf-8 encoded. Force to open the file in "binary" mode (which is the only mode on python2) and explicitly decode the read bytes to unicode using the 'utf-8' codec. Fixes: 8374e7d ("Use Markdown long_description on PyPI (#190)") Signed-off-by: Robin Jarry <[email protected]>
- Loading branch information