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

Adopt UTF-8 for .pth files on Python 3.13 #4306

Merged
merged 4 commits into from
Aug 28, 2024
Merged

Conversation

abravalheri
Copy link
Contributor

We should wait until a compatible version of Python3.13 is released (probably a beta).

Summary of changes

  • Use UTF-8 to write .pth files on Python 3.13
  • When reading .pth on Python 3.13 tries first UTF-8 and then fallback to locale (this is done to avoid errors caused by mixing installations created by different versions of setuptools in the same environment)

See reasoning in python/cpython#77102

Closes

Pull Request Checklist

@abravalheri
Copy link
Contributor Author

abravalheri commented May 22, 2024

The implementation in CPython was merged in 16 Apr and a new beta was released on 8 May (which I suppose includes the changes).

Maybe we can start to consider merging now.

There is a backport planned for 3.12, but I think if we try to consider it, it may make conditions more difficult: python/cpython#117917.

@abravalheri abravalheri marked this pull request as ready for review May 22, 2024 10:19
setuptools/compat/py312.py Outdated Show resolved Hide resolved
@abravalheri
Copy link
Contributor Author

I was waiting until we had a beta version of Python 3.13 on the CI, but with the change suggested in #4306 (comment), we might already be testing the change.

Based on https://github.com/pypa/setuptools/actions/runs/10593714996/job/29355829351?pr=4306, it seems that CPython 3.12.5 is being installed by setup-python:

image

@abravalheri abravalheri merged commit 2fca902 into pypa:main Aug 28, 2024
21 of 23 checks passed
@abravalheri abravalheri deleted the utf8-pth branch August 28, 2024 09:35
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