Skip to content

setup.py fails on Windows: README.md is read without an explicit encoding #21

Description

@arjxn-py

Summary

setup.py reads README.md without specifying an encoding, so Python falls back to the locale encoding. On Windows that is cp1252, which cannot decode the UTF-8 emoji in the README. This aborts metadata generation, so installing or building the package fails on Windows.

Linux and macOS are unaffected, because their locale encoding is already UTF-8.

Error

Traceback (most recent call last):
  ...
  File "<string>", line 11, in <module>
  File "...\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 0x8f in position 969: character maps to <undefined>

error: subprocess-exited-with-error
Preparing metadata (pyproject.toml) did not run successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions