Skip to content

gh-114685: Check flags in PyObject_GetBuffer() - #114707

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:buffer-invalid-flags
Jan 31, 2024
Merged

serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:buffer-invalid-flags

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jan 29, 2024 •

Copy link
Copy Markdown
Member

PyObject_GetBuffer() now raises a SystemError if called with PyBUF_READ or PyBUF_WRITE as flags. These flags should only be used with the PyMemoryView_* C API.

PyObject_GetBuffer() now raises a SystemError if called with
PyBUF_READ or PyBUF_WRITE as flags. These flags should
only be used with the PyMemoryView_* C API.

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 👍

@serhiy-storchaka
serhiy-storchaka merged commit b7688ef into python:main Jan 31, 2024
@serhiy-storchaka
serhiy-storchaka deleted the buffer-invalid-flags branch January 31, 2024 11:11
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
PyObject_GetBuffer() now raises a SystemError if called with
PyBUF_READ or PyBUF_WRITE as flags. These flags should
only be used with the PyMemoryView_* C API.
hroncok added a commit to hroncok/pycairo that referenced this pull request May 29, 2024
Since Python 3.13, the flag is no longer allowed.

See python/cpython#114707

Fixes pygobject#365
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants