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

set encoding utf-8 for reading readme in setup.py #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lorepirri
Copy link
Contributor

@lorepirri lorepirri commented Apr 10, 2024

Under Windows, while building the wheel:

...
                   INFO     Traceback (most recent call last):                                                                                                                                                      
                   INFO       File "<string>", line 2, in <module>                                                                                                                                                  
                   INFO       File "<pip-setuptools-caller>", line 34, in <module>                                                                                                                                  
                   INFO       File "C:\---\setup.py", line 7, in <module>                                                                           
                   INFO         long_description = (this_directory / "README.md").read_text()                                                                                                                       
                   INFO                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                       
...                                                     
                   INFO         return codecs.charmap_decode(input,self.errors,decoding_table)[0]                                                                                                                   
                   INFO                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                      
                   INFO     UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 115: character maps to <undefined>                                                                               
                   INFO     error: subprocess-exited-with-error                                                                                                                                                     
...

In setup.py the line:

long_description = (this_directory / "README.md").read_text()

is trying to open the README.md file that has at least 1 utf-8 character,

and therefore it is giving an error, for Windows:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 115: character maps to <undefined>

You can search for the error line, and see people struggling with that:

Setting the encoding to utf-8 will fix this for Windows and keep unix platforms working.

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.

None yet

1 participant