Skip to content

Pybind11 doesn't compile with CPython 3.9b1 #2224

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

Closed
bstaletic opened this issue May 22, 2020 · 6 comments
Closed

Pybind11 doesn't compile with CPython 3.9b1 #2224

bstaletic opened this issue May 22, 2020 · 6 comments

Comments

@bstaletic
Copy link
Collaborator

CPython recently released version 3.9.0b1. As is the wonderful custom, it comes with breaking changes.

Is pybind affected by python 3.9 breaking changes?

Yes and yes

Useful links:

PyEval_InitThreads() is deprecated and now does exactly nothing.
PyThreadState_DeleteCurrent() is "removed", or rather renamed to _PyThreadState_DeleteCurrent(). This one was never documented and the reason for the rename is "why would anyone ever use this function?"

@henryiii
Copy link
Collaborator

The fix for PyEval_InitThreads() looks easy: https://sourceware.org/pipermail/gdb-patches/2020-April/167630.html

A simple #if should fix it.

@henryiii
Copy link
Collaborator

The PyThreadState_DeleteCurrent() was supposed to be restored, per @wjakob's request: #1932 and https://bugs.python.org/issue38266 - there was a brief mention of adding an underscore, but it was not supposed to be added.

@bstaletic
Copy link
Collaborator Author

The fix for PyEval_InitThreads() looks easy: https://sourceware.org/pipermail/gdb-patches/2020-April/167630.html

Are we sure it is that easy in Pybind11, considering the ability to transfer GIL from one thread to another?

The PyThreadState_DeleteCurrent() was supposed to be restored

It was removed in python/cpython#15315.
Then the change was reverted in python/cpython#16558
The CPython docs haven't been updated and still claim that the function was removed (12th bulletpoint): https://docs.python.org/3.9/whatsnew/3.9.html#removed

@henryiii
Copy link
Collaborator

Docs are being fixed: python/cpython#20489 (review)

@bstaletic
Copy link
Collaborator Author

python/cpython#20489 is merged. This only leaves PyEval_InitThreads().

Ping @wjakob

@bstaletic
Copy link
Collaborator Author

This can be closed.

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

No branches or pull requests

2 participants