blindspin icon indicating copy to clipboard operation
blindspin copied to clipboard

Update setup.py to prevent UnicodeDecodeError

Open MorrisChuang opened this issue 5 years ago • 1 comments

Use "utf8" encoding to open "README.rst" to prevent UnicodeDecodeError below. UnicodeDecodeError: 'cp950' codec can't decode byte 0xe2 in position 189: illegal multibyte sequence

MorrisChuang avatar Dec 29 '19 02:12 MorrisChuang

The same issue for me, the README.rst on line 5 position 51 (I think) is a non ascii character. full error:

     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-cqtjn5f9/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-cqtjn5f9/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-t__bxh4k
         cwd: /tmp/pip-req-build-cqtjn5f9/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-cqtjn5f9/setup.py", line 7, in <module>
        readme = 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 0xe2 in position 189: ordinal not in range(128)
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

maozza avatar Aug 04 '20 10:08 maozza