Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup.py fails on windows because Readme.md is in utf-8 #280

Open
rxm7706 opened this issue Jan 14, 2023 · 0 comments
Open

Setup.py fails on windows because Readme.md is in utf-8 #280

rxm7706 opened this issue Jan 14, 2023 · 0 comments

Comments

@rxm7706
Copy link
Contributor

rxm7706 commented Jan 14, 2023

While running setup.py on windows I ran into an error
https://stackoverflow.com/questions/9233027/unicodedecodeerror-charmap-codec-cant-decode-byte-x-in-position-y-character
caused by

long_description = readme.read()

The 'README.md' is in UTF-8 encoding and to get around this I believe
changing
with open('README.md', 'r') as readme:
to
with open('README.md', mode='r', encoding='utf8') as readme:

should fix the issue

Full stack of error

Processing c:\bld\synthetic-data_1673701478775\work
  Added file:///C:/bld/synthetic-data_1673701478775/work to build tracker 'C:\\Users\\VssAdministrator\\AppData\\Local\\Temp\\pip-build-tracker-iyx3w6k1'
  Running setup.py (path:%SRC_DIR%\setup.py) egg_info for package from file:///C:/bld/synthetic-data_1673701478775/work
  Created temporary directory: C:\Users\VssAdministrator\AppData\Local\Temp\pip-pip-egg-info-0toyit36
  Preparing metadata (setup.py): started
  Running command python setup.py egg_info
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\bld\synthetic-data_1673701478775\work\setup.py", line 28, in <module>
      long_description = readme.read()
                         ^^^^^^^^^^^^^
    File "C:\bld\synthetic-data_1673701478775\_h_env\Lib\encodings\cp1252.py", line 23, in decode
      return codecs.charmap_decode(input,self.errors,decoding_table)[0]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 4882: character maps to <undefined>
  error: subprocess-exited-with-error
  
  python setup.py egg_info did not run successfully.
  exit code: 1
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

No branches or pull requests

1 participant