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

Replaced deprecated Py_FileSystemDefaultEncoding for Python >= 3.12 #7192

Merged
merged 1 commit into from
May 29, 2023

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented May 29, 2023

For #6941.

Python 3.12 reports a deprecation - https://github.com/python-pillow/Pillow/actions/runs/5105776867/jobs/9177570491#step:7:234

warning: 'Py_FileSystemDefaultEncoding' is deprecated

https://docs.python.org/3.12/whatsnew/3.12.html#id4 instructs us to replace it with PyConfig.filesystem_encoding.

Using https://docs.python.org/3.12/c-api/init_config.html#example as a basis, I made that change.

However, I found this failed on PyPy, with

error: use of undeclared identifier 'PyConfig'

I asked in https://foss.heptapod.net/pypy/pypy/-/issues/3946, and PyPy has chosen not to implement PyConfig yet. So I've switched to the new code only for Python 3.12 and later, and we can see what happens once PyPy does support Python 3.12.

@hugovk hugovk merged commit 3e3378f into python-pillow:main May 29, 2023
@radarhere radarhere deleted the deprecated branch May 29, 2023 21:24
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.

3 participants