Slight Issues with sip_array.c format being specified

Phil Thompson phil at riverbankcomputing.com
Tue Jul 4 11:19:18 BST 2023


On 26/06/2023 06:47, Ognyan Moore wrote:
> Hi Phil,
> 
> Just came across an issue in sip_array.c::sipArray_getbuffer
> 
> code to reproduce:
> 
>>>> from PyQt6 import sip, QtCore
>>>> memoryview(sip.array(QtCore.QPointF, 2))
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> BufferError: format has not been specified
> 
> Looks like non-scalar types don't have a format, and if the requestor
> requests a buffer format to be specified and there isn't one, an 
> exception
> is raised.
> 
> A more sensible default might be to set the format to bytes in this 
> case.
> There is some precedence here as python's PyBuffer_FillInfo will 
> populate
> format as "B".

Done in the next snapshot.

Thanks,
Phil


More information about the PyQt mailing list