-
- Downloads
Fix #106696: Invalid flag combinations used in #PyObject_GetBuffer
Code using #PyObject_GetBuffer was combining the `PyBUF_FORMAT` and `PyBUF_SIMPLE` flags, but the documentation specifies that `PyBUF_FORMAT` can be |'d to any of the flags except `PyBUF_SIMPLE` because the latter already implies format `B` (unsigned bytes). The flags in such cases have been replaced with `PyBUF_ND | PyBUF_FORMAT`, which has the additional requirement that the buffer must provide it's `shape` field. This fixes `memoryview` objects raising a `BufferError` when requested, due to the invalid combination of flags making them be considered invalid buffers when they would otherwise be valid. Ref: !106697
Loading
Please register or sign in to comment