Skip to content

Fix dlopen for Python 3.16 - #289

Closed
emmatyping wants to merge 1 commit into
python-cffi:mainfrom
emmatyping:fix-for-3.16
Closed

emmatyping wants to merge 1 commit into
python-cffi:mainfrom
emmatyping:fix-for-3.16

Conversation

@emmatyping

@emmatyping emmatyping commented Oct 22, 2026 •

Copy link
Copy Markdown

Python 3.16 removes the deprecated Py_FileSystemDefaultEncoding. Python 3.14 provides a PyConfig_Get() API to query the filesystem encoding in it's place. This change uses the new API on 3.14+. I can also do this on 3.16+ if you prefer.

This was caught by snake_pit, a project I've created to test Python 3.16 against popular Python projects to understand when we break downstream projects. Given cffi is popular, and used by many popular projects, I would like to fix this error early so we can try to run regression tests against cffi and projects that depend on it.

AI disclosure, this was reviewed by an LLM.

Python 3.16 removes the deprecated Py_FileSystemDefaultEncoding. Python
3.14 provides a PyConfig_Get() API to query the filesystem encoding in
it's place. This change uses the new API on 3.14+.
@emmatyping

Copy link
Copy Markdown
Author

Apologies, I should have looked through open PRs.

@emmatyping emmatyping closed this Oct 22, 2026
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.

1 participant