[PyQt] Bug when PyQt5 sends Python bytes object via signal between threads
phil at riverbankcomputing.com
Sun Dec 4 14:40:53 GMT 2016
On 1 Dec 2016, at 9:38 am, Rudolf Cardinal <rudolf at pobox.com> wrote:
> Dear all,
> I think I've found a bug in the way that PyQt5 sends Python 3 "bytes" objects as signal parameters. They can arrive corrupted, and this seems to happen only when (a) the signal is sent to another thread (via the default Qt::AutoConnection type), and (b) the object being sent is created as a temporary variable.
> I suspect this means that the reference counting has gone wrong and the temporary is being garbage-collected before or during receipt, so the receiver is effectively using a dangling pointer, and I note that "bytes" objects seem to have a special "don't know, call it a const char*" handling in qpycore_chimera.cpp (line 419), but I'm not sure exactly what the root problem is.
I think this is already fixed in the snapshots.
More information about the PyQt