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

Always read metadata files as UTF-8 in setup.py #1748

Merged
merged 1 commit into from
Nov 29, 2023

Commits on Nov 29, 2023

  1. Always read metadata files as UTF-8 in setup.py

    This passes `encoding="utf-8"` to the `open` calls in setup.py, so
    the readme, version, and requirements files are always read as
    UTF-8, even on systems whose locale is not UTF-8. This fixes the
    bug described in gitpython-developers#1747 where installation other than from a
    pre-built wheel would fail on many Windows systems using
    non-European languages.
    
    The specific problem occurred with the README.md file. The
    requirements files are less likely to contain characters not in the
    ASCII subset, though maybe they could come to contain them, perhaps
    in comments. The VERSION file is even less likely to ever contain
    such characters. Nonetheless, for consistency, because it is a best
    practice, and because it appears to be the intent of the existing
    code, encoding="utf=8" is added for opening all of them.
    
    This change is tested on a system whose locale uses Windows code
    page 936. Editable installation, as well as the other affected ways
    of installing (and building) described in gitpython-developers#1747, are now working.
    EliahKagan committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    6727d0e View commit details
    Browse the repository at this point in the history