[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: Issue with PyQt6 QByteArray
From:       Detlev Offenbach <detlev () die-offenbachs ! de>
Date:       2021-05-21 16:07:13
Message-ID: 4c4ca2c9-61b3-ae0e-fb2d-476da1f89afc () die-offenbachs ! de
[Download RAW message or body]


Am 20.05.21 um 18:11 schrieb Phil Thompson:
> On 18/05/2021 16:33, Detlev Offenbach wrote:
>> Hello,
>>
>> PyQt6.QtCore.QByteArray works faulty when copying the data from
>> another QByteArray or a bytes object containing a zero character (\0)
>> as oart of its contents. The resulting QByteArray only contains the
>> data up to the zero. See following examples.
>>
>> *PyQt5 (OK)*:
>>>>> from PyQt5.QtCore import QByteArray
>>>>> b=b'abc\0def'
>>>>> b
>> b'abc\x00def'
>>>>> ba=QByteArray(b)
>>>>> ba
>> PyQt5.QtCore.QByteArray(b'abc\x00def')
>>
>> *PyQt6 (faulty)*:
>>>>> from PyQt6.QtCore import QByteArray
>>>>> b=b'abc\0def'
>>>>> b
>> b'abc\x00def'
>>>>> ba=QByteArray(b)
>>>>> ba
>> PyQt6.QtCore.QByteArray(b'abc')
>>
>> *PySide6 (OK)*:
>>>>> from PySide6.QtCore import QByteArray
>>>>> b=b'abc\0def'
>>>>> b
>> b'abc\x00def'
>>>>> ba=QByteArray(b)
>>>>> ba
>> PySide6.QtCore.QByteArray(b'abc\x00def')
>>
>> This shows, that the issue is related to PyQt6 and not Qt6.
>
> Fixed in the next snapshot.
>
>
I am confirming this fix works as expected.

-- 
Detlev Offenbach
detlev@die-offenbachs.de

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic