-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-114685: PyBuffer_FillInfo
now raises on PyBUF_{READ,WRITE}
#114802
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
Conversation
350a6e7
to
7e480af
Compare
Co-authored-by: AN Long <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #60198. PyBuffer_FillInfo()
with NULL as exporter is a fragile thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
Yet one nitpick. The code relies on the fact that b"abc"
still exists after returning from buffer_fill_info()
. It is so in CPython, but this is an implementation detail. It would be more reliable to explicitly keep a reference to it:
source = b'abc'
...
buffer_fill_info(source, ...)
Thank you! I always learn a lot from your reviews, very helpful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
_imp.get_frozen_object
possible incorrect use ofPyBUF_READ
#114685