Closed
Description
Bug report
It is documented that PyBUF_READ
should be used with memoryview
objects. But, it is used in PyObject_GetBuffer
:
Line 3547 in 5ecfd75
Other similar places that access .buf
and .len
just use PyBUF_SIMPLE
, which I think we should use here as well.
I will send a PR.
Originally found by @serhiy-storchaka in #114669 (comment)
Linked PRs
- gh-114685: Fix incorrect use of
PyBUF_READ
inimport.c
#114686 - [3.12] gh-114685: Fix incorrect use of PyBUF_READ in import.c (GH-114686) #114700
- [3.11] gh-114685: Fix incorrect use of PyBUF_READ in import.c (GH-114686) #114701
- gh-114685: Check flags in PyObject_GetBuffer() #114707
- gh-114685:
PyBuffer_FillInfo
now raises onPyBUF_{READ,WRITE}
#114802