-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
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
if (PyObject_GetBuffer(dataobj, &buf, PyBUF_READ) != 0) { |
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
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error