Skip to content

Update setup.py to prevent UnicodeDecodeError - #7

Open
MorrisChuang wants to merge 1 commit into
not-kennethreitz:masterfrom
MorrisChuang:patch-1
Open

Update setup.py to prevent UnicodeDecodeError#7
MorrisChuang wants to merge 1 commit into
not-kennethreitz:masterfrom
MorrisChuang:patch-1

Conversation

@MorrisChuang

Copy link
Copy Markdown

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

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
@maozza

maozza commented Aug 4, 2020

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants