-
Notifications
You must be signed in to change notification settings - Fork 85
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
PyObject_AsWriteBuffer is removed from CPython in 3.10 #190
PyObject_AsWriteBuffer is removed from CPython in 3.10 #190
Comments
3.10 will become an issue once it hits beta 2021-05-03 (https://www.python.org/dev/peps/pep-0619/) so not that pressing. But thanks for bringing it up! My first try would be to just see what PyObject_AsWriteBuffer does internally and see it it's viable to replicate that. Here is the PR removing it from CPython: python/cpython#21117 |
This is hitting me now in travis-ci in the Python: nightly build. Hopefully I will notice the github notifies later... |
ok, if it affects people today we should try to look into it. |
PyObject_AsWriteBuffer() is removed in Python 3.10. Port things to use PyObject_GetBuffer() and PyBuffer_Release() instead. This does more or less the same, but instead of keeping the object which provides the buffer alive we now keep the buffer itself alive, which in turn keeps a reference on the exporting object. See pygobject#190
PyObject_AsWriteBuffer is gone in master, PyObject_AsReadBuffer still needs to be removed. |
See https://github.com/python/cpython/blob/e4f1fe6edb216e04da03ae80b462ca273f00255b/Doc/whatsnew/3.10.rst#removed-1
It looks like PyObject_AsWriteBuffer is currently a wrapper around the new API (https://docs.python.org/3/c-api/objbuffer.html?highlight=pyobject_aswritebuffer#c.PyObject_AsWriteBuffer).
It looks like pycairo uses this function in one place (and wraps it to suppress the deprecation warnings)
pycairo/cairo/surface.c
Lines 823 to 825 in f0c0e5a
Unfortunately I do not have time right now to dig into this and offer a fix.
The text was updated successfully, but these errors were encountered: