Bug report
It is documented that PyBUF_READ should be used with memoryview objects. But, it is used in PyObject_GetBuffer:
|
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