segfault using PyQt6 version 6.10.1
Phil Thompson
phil at riverbankcomputing.com
Fri Dec 26 12:53:18 GMT 2025
On 24/12/2025 14:09, Dmitry Shachnev wrote:
> On Wed, Dec 24, 2025 at 11:13:46AM +0000, Phil Thompson wrote:
>> PyQt v6.10.1 changed the /Factory/ annotation to /Transfer/ on
>> QPlainTextEdit::createMimeDataFromSelection() to match the fix to
>> createStandardContextMenu() as the language used to describe the
>> ownership
>> changes in the docs is the same. A (possibly significant) difference
>> is that
>> the former is virtual and the latter isn't. The obvious fix would be
>> just to
>> revert that change (and to QTextEdit) but it's possible that that is
>> still
>> buggy.
>
> Thank you! It works, at least calibre no longer crashes.
>
> Here is a patch with revert, in case someone else needs it:
> https://salsa.debian.org/python-team/packages/pyqt6/-/blob/debian/master/debian/patches/Revert-changes-for-createMimeDataFromSelection.patch
>
>> I'll look at in the next few days, but a similar valgrind long using
>> PyQt6
>> v6.10.0 would be very useful...
>
> With v6.10.0 there are no errors from valgrind and no crash.
>
> With --leak-check=full I also do not see any leaks coming from this
> part of
> the code. Attached the output.
I think this may be a bug in calibre (exposed by the change in v6.10.1).
calibre must have a Python reimplementation of
createMimeDataFromSelection() that returns a QMimeData object. It should
(according to the Qt docs) set the parent of that object to be the text
editor. I suspect that it doesn't.
Phil
More information about the PyQt
mailing list