cannot convert memoryview to QByteArray

Phil Thompson phil at riverbankcomputing.com
Sun Sep 1 12:43:29 BST 2024


On 01/09/2024 10:09, Kovid Goyal wrote:
> Converting a memoryview created froma  bytes object to QByteArray 
> fails:
> 
> python -c 'from PyQt6.QtCore import QByteArray; 
> QByteArray(memoryview(b"a"))'
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> BufferError: memoryview: cannot cast to unsigned bytes if the format
> flag is present

Works fine for me. What are the platform and version details?

Phil


More information about the PyQt mailing list