ealbiter / qnotero

Standalone sidekick to the Zotero reference manager
Other
50 stars 5 forks source link

Crash under sway on ArchLinux #13

Closed MayeulC closed 2 years ago

MayeulC commented 2 years ago

Hi, I just installed qnotero from the AUR under Arch Linux.

The program displayed the first-time configuration window, and now starts minimized to the tray. So far so good.

However, when I call the search popup, entering a search term makes the program crash (shortly after it writes in the search bar "36 results found"). I note that the window is not floating by default, but it still crashes when I make it floating.

Did the Qt API change? Or is it a Python issue? I use Python 3.10.4 and Qt 6.3.0. It seems like you pass floats to functions that expect ints. You also use a lot 0.5*value or 0.1*value, where value//2 and value//10 could work too, not sure if that could help not to generate floats, but I'd expect so.

Casting to ints seems to work around the issue, and the program works fine. See the attached patch, but it is probably a bit rough, as I quickly did this to see if it would help.

Execution log, with me reproducing the issue under both x11 and wayland ``` mcantan@leom039 ~ % qnotero Using Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] libqnotero._themes.light.__init__(): using '/usr/share/qnotero/resources/light' qnotero.reInit(): using GnoteProvider libgnote.__init__(): failed to locate Gnote libzotero.__init__(): zotero_path = b'' libzotero.update(): [Errno 2] Aucun fichier ou dossier de ce type: 'zotero.sqlite' saving! org.kde.kf5.kwindowsystem.kwayland: This compositor does not support the Shadow interface org.kde.kf5.kwindowsystem.kwayland: This compositor does not support the Shadow interface org.kde.kf5.kwindowsystem.kwayland: This compositor does not support the Shadow interface libqnotero._themes.light.__init__(): using '/usr/share/qnotero/resources/light' qnotero.reInit(): using GnoteProvider libgnote.__init__(): failed to locate Gnote libzotero.__init__(): zotero_path = b'/home/mcantan/Zotero' libzotero.update(): indexing completed in 0.118s 92 entries processed libzotero.search(): search for 'dummy' completed in 0.000s libzotero.update(): indexing completed in 0.015s 92 entries processed qt.qpa.wayland: Wayland does not support QWindow::requestActivate() libzotero.search(): search for 'ferro' completed in 0.001s Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/libqnotero/qnoteroItemDelegate.py", line 76, in sizeHint return QSize(0, self.height) TypeError: arguments did not match any overloaded call: QSize(): too many arguments QSize(int, int): argument 2 has unexpected type 'float' QSize(QSize): argument 1 has unexpected type 'int' zsh: IOT instruction (core dumped) qnotero mcantan@leom039 ~ % qnotero -platform xcb Using Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] libqnotero._themes.light.__init__(): using '/usr/share/qnotero/resources/light' qnotero.reInit(): using GnoteProvider libgnote.__init__(): failed to locate Gnote libzotero.__init__(): zotero_path = b'/home/mcantan/Zotero' libzotero.update(): indexing completed in 0.013s 92 entries processed libzotero.search(): search for 'dummy' completed in 0.000s libzotero.search(): search for 'ferro' completed in 0.000s Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/libqnotero/qnoteroItemDelegate.py", line 76, in sizeHint return QSize(0, self.height) TypeError: arguments did not match any overloaded call: QSize(): too many arguments QSize(int, int): argument 2 has unexpected type 'float' QSize(QSize): argument 1 has unexpected type 'int' zsh: IOT instruction (core dumped) qnotero -platform xcb mcantan@leom039 ~ % QT_QPA_PLATFORM=xcb qnotero Using Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] libqnotero._themes.light.__init__(): using '/usr/share/qnotero/resources/light' qnotero.reInit(): using GnoteProvider libgnote.__init__(): failed to locate Gnote libzotero.__init__(): zotero_path = b'/home/mcantan/Zotero' libzotero.update(): indexing completed in 0.013s 92 entries processed libzotero.search(): search for 'dummy' completed in 0.000s libzotero.search(): search for 'ferro' completed in 0.001s Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/libqnotero/qnoteroItemDelegate.py", line 76, in sizeHint return QSize(0, self.height) TypeError: arguments did not match any overloaded call: QSize(): too many arguments QSize(int, int): argument 2 has unexpected type 'float' QSize(QSize): argument 1 has unexpected type 'int' zsh: IOT instruction (core dumped) QT_QPA_PLATFORM=xcb qnotero mcantan@leom039 ~ % ```
Multiple backtraces while I add `int()` casts to the code ``` % QT_QPA_PLATFORM=xcb qnotero :) Using Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] libqnotero._themes.light.__init__(): using '/usr/share/qnotero/resources/light' qnotero.reInit(): using GnoteProvider libgnote.__init__(): failed to locate Gnote libzotero.__init__(): zotero_path = b'/home/mcantan/Zotero' libzotero.update(): indexing completed in 0.119s 92 entries processed libzotero.search(): search for 'dummy' completed in 0.001s sysTray.activate(): Activating qnotero reason: 3 libzotero.search(): search for 'ferro' completed in 0.001s Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/libqnotero/qnoteroItemDelegate.py", line 119, in paint _rect = option.rect.adjusted(self._margin, self._margin, TypeError: adjusted(self, int, int, int, int): argument 1 has unexpected type 'float' zsh: IOT instruction (core dumped) QT_QPA_PLATFORM=xcb qnotero mcantan@leom039 ~ % QT_QPA_PLATFORM=xcb qnotero134 :( Using Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] libqnotero._themes.light.__init__(): using '/usr/share/qnotero/resources/light' qnotero.reInit(): using GnoteProvider libgnote.__init__(): failed to locate Gnote libzotero.__init__(): zotero_path = b'/home/mcantan/Zotero' libzotero.update(): indexing completed in 0.012s 92 entries processed libzotero.search(): search for 'dummy' completed in 0.000s sysTray.activate(): Activating qnotero reason: 3 libzotero.search(): search for 'fer' completed in 0.001s Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/libqnotero/qnoteroItemDelegate.py", line 133, in paint _rect.moveBottom(_rect.bottom() + 0.5*self.dy) TypeError: moveBottom(self, int): argument 1 has unexpected type 'float' zsh: IOT instruction (core dumped) QT_QPA_PLATFORM=xcb qnotero mcantan@leom039 ~ % QT_QPA_PLATFORM=xcb qnotero134 :( Using Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] libqnotero._themes.light.__init__(): using '/usr/share/qnotero/resources/light' qnotero.reInit(): using GnoteProvider libgnote.__init__(): failed to locate Gnote libzotero.__init__(): zotero_path = b'/home/mcantan/Zotero' libzotero.update(): indexing completed in 0.012s 92 entries processed libzotero.search(): search for 'dummy' completed in 0.000s sysTray.activate(): Activating qnotero reason: 3 libzotero.search(): search for 'fer' completed in 0.000s Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/libqnotero/qnoteroItemDelegate.py", line 134, in paint _rect.moveLeft(_rect.left() + 0.5*self.dy) TypeError: moveLeft(self, int): argument 1 has unexpected type 'float' zsh: IOT instruction (core dumped) QT_QPA_PLATFORM=xcb qnotero mcantan@leom039 ~ % QT_QPA_PLATFORM=xcb qnotero134 :( Using Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] libqnotero._themes.light.__init__(): using '/usr/share/qnotero/resources/light' qnotero.reInit(): using GnoteProvider libgnote.__init__(): failed to locate Gnote libzotero.__init__(): zotero_path = b'/home/mcantan/Zotero' libzotero.update(): indexing completed in 0.012s 92 entries processed libzotero.search(): search for 'dummy' completed in 0.001s sysTray.activate(): Activating qnotero reason: 3 libzotero.search(): search for 'fer' completed in 0.000s Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/libqnotero/qnoteroItemDelegate.py", line 135, in paint _rect.setHeight(self.pixmapSize) TypeError: setHeight(self, int): argument 1 has unexpected type 'float' zsh: IOT instruction (core dumped) QT_QPA_PLATFORM=xcb qnotero mcantan@leom039 ~ % QT_QPA_PLATFORM=xcb qnotero134 :( Using Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] libqnotero._themes.light.__init__(): using '/usr/share/qnotero/resources/light' qnotero.reInit(): using GnoteProvider libgnote.__init__(): failed to locate Gnote libzotero.__init__(): zotero_path = b'/home/mcantan/Zotero' libzotero.update(): indexing completed in 0.012s 92 entries processed libzotero.search(): search for 'dummy' completed in 0.000s sysTray.activate(): Activating qnotero reason: 3 libzotero.search(): search for 'fer' completed in 0.001s Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/libqnotero/qnoteroItemDelegate.py", line 141, in paint _rect = option.rect.adjusted(self.pixmapSize+0.5*self.dy, 0.5*self.dy, TypeError: adjusted(self, int, int, int, int): argument 1 has unexpected type 'float' zsh: IOT instruction (core dumped) QT_QPA_PLATFORM=xcb qnotero mcantan@leom039 ~ % QT_QPA_PLATFORM=xcb qnotero134 :( Using Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] libqnotero._themes.light.__init__(): using '/usr/share/qnotero/resources/light' qnotero.reInit(): using GnoteProvider libgnote.__init__(): failed to locate Gnote libzotero.__init__(): zotero_path = b'/home/mcantan/Zotero' libzotero.update(): indexing completed in 0.012s 92 entries processed libzotero.search(): search for 'dummy' completed in 0.000s sysTray.activate(): Activating qnotero reason: 3 libzotero.search(): search for 'fer' completed in 0.001s Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/libqnotero/qnoteroItemDelegate.py", line 152, in paint _rect = _rect.adjusted(0, self.dy, 0, 0) TypeError: adjusted(self, int, int, int, int): argument 2 has unexpected type 'float' zsh: IOT instruction (core dumped) QT_QPA_PLATFORM=xcb qnotero mcantan@leom039 ~ % QT_QPA_PLATFORM=xcb qnotero134 :( Using Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] libqnotero._themes.light.__init__(): using '/usr/share/qnotero/resources/light' qnotero.reInit(): using GnoteProvider libgnote.__init__(): failed to locate Gnote libzotero.__init__(): zotero_path = b'/home/mcantan/Zotero' libzotero.update(): indexing completed in 0.012s 92 entries processed libzotero.search(): search for 'dummy' completed in 0.000s sysTray.activate(): Activating qnotero reason: 3 libzotero.search(): search for 'fer' completed in 0.001s libzotero.search(): search for 'ferro' completed in 0.000s ```
Here is the full backtrace ``` (gdb) bt full #0 0x00007fd4e0b9834c in __pthread_kill_implementation () from /usr/lib/libc.so.6 No symbol table info available. #1 0x00007fd4e0b4b4b8 in raise () from /usr/lib/libc.so.6 No symbol table info available. #2 0x00007fd4e0b35534 in abort () from /usr/lib/libc.so.6 No symbol table info available. #3 0x00007fd4df344ee4 in qt_message_fatal (message=..., context=...) at global/qlogging.cpp:1914 No locals. #4 QMessageLogger::fatal (this=this@entry=0x7ffe277fa960, msg=msg@entry=0x7fd4dc22305f "%s") at global/qlogging.cpp:893 message = ap = {{gp_offset = 24, fp_offset = 48, overflow_arg_area = 0x7ffe277fa930, reg_save_area = 0x7ffe277fa870}} #5 0x00007fd4dc0b9048 in pyqt5_err_print () at ../../qpy/QtCore/qpycore_public_api.cpp:254 _save = new_stderr = old_stderr = message = {d = 0x55fdce36fd60} stringio_ctor = exception = 0x7fd4e10b3d80 value = 0x7fd4dbf7e010 traceback = 0x7fd4dafeb4c0 hook = recursing = true original_hook = 0x7fd4e06b25c0 stringio_ctor = 0x7fd4e10974e0 #6 0x00007fd4dc31dff4 in sip_api_call_error_handler (sipGILState=PyGILState_UNLOCKED, py_self=0x7fd4db2e8c10, error_handler=0x7fd4dc0b9730 ) at /usr/src/debug/PyQt5_sip-12.10.1/siplib.c:2770 No locals. #7 sip_api_parse_result_ex (gil_state=PyGILState_UNLOCKED, error_handler=0x7fd4dc0b9730 , py_self=0x7fd4db2e8c10, method=0x7fd4dafd7a00, res=0x0, fmt=) at /usr/src/debug/PyQt5_sip-12.10.1/siplib.c:2754 rc = #8 0x00007fd4dbb05960 in sipVH_QtWidgets_39 (sipGILState=PyGILState_UNLOCKED, sipErrorHandler=0x7fd4dc0b9730 , sipPySelf=0x7fd4db2e8c10, sipMethod=0x7fd4dafd7a00, a0=..., a1=...) at /usr/src/debug/PyQt5-5.15.6/build/QtWidgets/sipQtWidgetscmodule.cpp:6561 sipRes = {wd = -1, ht = -1} sipResObj = #9 0x00007fd4dbb92a6b in sipQStyledItemDelegate::sizeHint (this=0x55fdce1e23b0, a0=..., a1=...) at /usr/src/debug/PyQt5-5.15.6/build/QtWidgets/sipQtWidgetsQStyledItemDelegate.cpp:384 sipGILState = PyGILState_UNLOCKED sipMeth = #10 0x00007fd4db734a6d in QCommonListViewBase::itemSize (idx=..., opt=..., this=0x55fdce2d53b0) at ../../include/QtWidgets/5.15.3/QtWidgets/private/../../../../../src/widgets/itemviews/qlistview_p.h:492 No locals. #11 QListModeViewBase::doStaticLayout (this=0x55fdce2d53b0, info=...) at itemviews/qlistview.cpp:2583 hint = row = 0 useItemSize = topLeft = option = { = {version = 4, type = 10, state = {i = 1}, direction = Qt::LeftToRight, rect = {x1 = 0, y1 = 0, x2 = 399, y2 = 497}, fontMetrics = {d = {d = 0x7fd4d4001490}}, palette = { d = 0x55fdce086900, {data = {current_group = 0, resolve_mask = 0}, for_faster_swapping_dont_use = 0}}, styleObject = 0x55fdce39c790}, displayAlignment = {i = 129}, decorationAlignment = {i = 132}, textElideMode = Qt::ElideRight, decorationPosition = QStyleOptionViewItem::Left, decorationSize = {wd = 16, ht = 16}, font = {d = {d = 0x7fd4d4001490}, resolve_mask = 0}, showDecorationSelected = false, features = {i = 0}, locale = {d = {d = 0x7fd4d4008dc0}}, widget = 0x55fdce39c790, index = {r = -1, c = -1, i = 0, m = 0x0}, checkState = Qt::Unchecked, icon = {d = 0x0}, text = {d = 0x7fd4df619ee0 }, viewItemPosition = QStyleOptionViewItem::Invalid, backgroundBrush = {d = {d = 0x55fdcdf208e0}}} segStartPosition = 0 segEndPosition = 498 deltaFlowPosition = -1 deltaSegPosition = deltaSegHint = -1 flowPosition = 0 segPosition = 0 rect = changedRect = {x1 = 0, y1 = 497, x2 = 662678656, y2 = 32766} --Type for more, q to quit, c to continue without paging--c #12 0x00007fd4db7289d4 in QListModeViewBase::doBatchedItemLayout (this=0x55fdce2d53b0, info=..., max=35) at itemviews/qlistview.cpp:2450 No locals. #13 0x00007fd4db730419 in QListViewPrivate::doItemsLayout (this=this@entry=0x55fdce2d55d0, delta=) at itemviews/qlistview.cpp:1831 max = 35 first = 0 last = info = {bounds = {x1 = 0, y1 = 0, x2 = 399, y2 = 497}, grid = {wd = -1, ht = -1}, spacing = 0, first = 0, last = 35, wrap = false, flow = QListView::TopToBottom, max = 35} #14 0x00007fd4db73074a in QListView::doItemsLayout (this=0x55fdce39c790) at itemviews/qlistview.cpp:1543 d = 0x55fdce2d55d0 oldState = QAbstractItemView::NoState #15 0x00007fd4db6f214f in QAbstractItemView::timerEvent (this=0x55fdce39c790, event=) at itemviews/qabstractitemview.cpp:2552 current = {r = 0, c = 0, i = 94548566840048, m = 0x17} d = 0x55fdce2d55d0 #16 0x00007fd4dbc10234 in sipQListWidget::timerEvent (this=0x55fdce39c790, a0=0x7ffe277fb0a0) at /usr/src/debug/PyQt5-5.15.6/build/QtWidgets/sipQtWidgetsQListWidget.cpp:1221 sipGILState = (unknown: 0x7fd4) sipMeth = #17 0x00007fd4df555766 in QObject::event (this=0x55fdce39c790, e=0x7ffe277fb0a0) at kernel/qobject.cpp:1291 No locals. #18 0x00007fd4db571c53 in QFrame::event (this=0x55fdce39c790, e=0x7ffe277fb0a0) at widgets/qframe.cpp:550 result = #19 0x00007fd4dbc1036c in sipQListWidget::event (this=0x55fdce39c790, a0=0x7ffe277fb0a0) at /usr/src/debug/PyQt5-5.15.6/build/QtWidgets/sipQtWidgetsQListWidget.cpp:1253 sipGILState = (PyGILState_UNLOCKED | unknown: 0x55fc) sipMeth = #20 0x00007fd4db48c2c6 in QApplicationPrivate::notify_helper (this=this@entry=0x0, receiver=receiver@entry=0x55fdce39c790, e=e@entry=0x7ffe277fb0a0) at kernel/qapplication.cpp:3637 consumed = false filtered = false #21 0x00007fd4db49088b in QApplication::notify (this=0x7ffe277fb098, this@entry=0x55fdcdee07f0, receiver=receiver@entry=0x55fdce39c790, e=e@entry=0x7ffe277fb0a0) at kernel/qapplication.cpp:3383 w = extra = isProxyWidget = d = 0x0 res = false #22 0x00007fd4dbd46507 in sipQApplication::notify (this=0x55fdcdee07f0, a0=0x55fdce39c790, a1=0x7ffe277fb0a0) at /usr/src/debug/PyQt5-5.15.6/build/QtWidgets/sipQtWidgetsQApplication.cpp:247 sipGILState = (unknown: 0x7fd4) sipMeth = #23 0x00007fd4df5315aa in QCoreApplication::notifyInternal2 (receiver=0x55fdce39c790, event=0x7ffe277fb0a0) at kernel/qcoreapplication.cpp:1064 selfRequired = true result = false cbdata = {0x55fdce39c790, 0x7ffe277fb0a0, 0x7ffe277fb02f} d = threadData = 0x55fdcdbde360 scopeLevelCounter = {threadData = 0x55fdcdbde360} #24 0x00007fd4df57cdd5 in QTimerInfoList::activateTimers (this=0x55fdce05c770) at kernel/qtimerinfo_unix.cpp:643 e = { = {_vptr.QEvent = 0x7fd4df7b83a8 , static staticMetaObject = {d = {superdata = {direct = 0x0}, stringdata = 0x7fd4df60d0a0 <_ZL25qt_meta_stringdata_QEvent.lto_priv.0>, data = 0x7fd4df60cae0 <_ZL19qt_meta_data_QEvent.lto_priv.0>, static_metacall = 0x0, relatedMetaObjects = 0x0, extradata = 0x0}}, d = 0x0, t = 1, posted = 0, spont = 0, m_accept = 1, reserved = 1263}, id = 1} currentTimerInfo = 0x0 n_act = 0 maxCount = 0 currentTime = {tv_sec = 13325, tv_nsec = 5880057} #25 0x00007fd4df57d402 in timerSourceDispatch (source=) at kernel/qeventdispatcher_glib.cpp:183 timerSource = timerSource = #26 idleTimerSourceDispatch (source=) at kernel/qeventdispatcher_glib.cpp:230 timerSource = #27 0x00007fd4de65a163 in g_main_dispatch (context=0x7fd4d4005070) at ../glib/glib/gmain.c:3417 dispatch = 0x7fd4df57d3d0 prev_source = 0x0 begin_time_nsec = 13325005879400 was_in_call = user_data = 0x0 callback = 0x0 cb_funcs = 0x0 cb_data = 0x0 need_destroy = source = 0x55fdce05e830 current = 0x55fdce210100 i = 1 __func__ = #28 g_main_context_dispatch (context=0x7fd4d4005070) at ../glib/glib/gmain.c:4135 No locals. #29 0x00007fd4de6b09e9 in g_main_context_iterate.constprop.0 (context=context@entry=0x7fd4d4005070, block=block@entry=1, dispatch=dispatch@entry=1, self=) at ../glib/glib/gmain.c:4211 max_priority = 0 timeout = 0 some_ready = 1 nfds = 1 allocated_nfds = 1 fds = 0x55fdce2efea0 begin_time_nsec = 13325004369917 #30 0x00007fd4de6576c5 in g_main_context_iteration (context=0x7fd4d4005070, may_block=1) at ../glib/glib/gmain.c:4276 retval = #31 0x00007fd4df57d57a in QEventDispatcherGlib::processEvents (this=0x55fdce055de0, flags=...) at kernel/qeventdispatcher_glib.cpp:423 d = 0x55fdcdc9d4b0 canWait = savedFlags = {i = 0} result = #32 0x00007fd4df52988b in QEventLoop::exec (this=0x7ffe277fb340, flags=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69 d = 0x55fdce221920 threadData = locker = {val = 94548567898920} ref = app = #33 0x00007fd4df534fd7 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121 threadData = 0x55fdcdbde360 eventLoop = { = {_vptr.QObject = 0x7fd4df7b6710 , static staticMetaObject = {d = {superdata = {direct = 0x0}, stringdata = 0x7fd4df618940 <_ZL26qt_meta_stringdata_QObject.lto_priv.0>, data = 0x7fd4df618820 <_ZL20qt_meta_data_QObject.lto_priv.0>, static_metacall = 0x7fd4df562740 , relatedMetaObjects = 0x0, extradata = 0x0}}, d_ptr = {d = 0x55fdce221920}, static staticQtMetaObject = {d = {superdata = {direct = 0x0}, stringdata = 0x7fd4df63f5c0 <_ZL21qt_meta_stringdata_Qt.lto_priv.0>, data = 0x7fd4df63c740 <_ZL15qt_meta_data_Qt.lto_priv.0>, static_metacall = 0x0, relatedMetaObjects = 0x0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = {direct = 0x7fd4df7af520 }, stringdata = 0x7fd4df614300 <_ZL29qt_meta_stringdata_QEventLoop.lto_priv.0>, data = 0x7fd4df6142a0 <_ZL23qt_meta_data_QEventLoop.lto_priv.0>, static_metacall = 0x7fd4df5285b0 , relatedMetaObjects = 0x0, extradata = 0x0}}} returnCode = #34 0x00007fd4df9001d2 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1867 No locals. #35 0x00007fd4db48a64a in QApplication::exec () at kernel/qapplication.cpp:2829 No locals. #36 0x00007fd4dbd48d80 in meth_QApplication_exec_ (sipArgs=) at /usr/src/debug/PyQt5-5.15.6/build/QtWidgets/sipQtWidgetsQApplication.cpp:1482 _save = 0x55fdcdbd92f0 sipRes = sipParseErr = 0x0 #37 0x00007fd4e0e63488 in ?? () from /usr/lib/libpython3.10.so.1.0 No symbol table info available. #38 0x00007fd4e0e5cddb in _PyObject_MakeTpCall () from /usr/lib/libpython3.10.so.1.0 No symbol table info available. #39 0x00007fd4e0e581c5 in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.10.so.1.0 No symbol table info available. #40 0x00007fd4e0e51752 in ?? () from /usr/lib/libpython3.10.so.1.0 No symbol table info available. #41 0x00007fd4e0f08f64 in PyEval_EvalCode () from /usr/lib/libpython3.10.so.1.0 No symbol table info available. #42 0x00007fd4e0f18df4 in ?? () from /usr/lib/libpython3.10.so.1.0 No symbol table info available. #43 0x00007fd4e0f147bb in ?? () from /usr/lib/libpython3.10.so.1.0 No symbol table info available. #44 0x00007fd4e0db0c13 in ?? () from /usr/lib/libpython3.10.so.1.0 No symbol table info available. #45 0x00007fd4e0db0893 in _PyRun_SimpleFileObject () from /usr/lib/libpython3.10.so.1.0 No symbol table info available. #46 0x00007fd4e0db1228 in _PyRun_AnyFileObject () from /usr/lib/libpython3.10.so.1.0 No symbol table info available. #47 0x00007fd4e0f256ab in Py_RunMain () from /usr/lib/libpython3.10.so.1.0 No symbol table info available. #48 0x00007fd4e0ef998d in Py_BytesMain () from /usr/lib/libpython3.10.so.1.0 No symbol table info available. #49 0x00007fd4e0b36310 in __libc_start_call_main () from /usr/lib/libc.so.6 No symbol table info available. #50 0x00007fd4e0b363c1 in __libc_start_main_impl () from /usr/lib/libc.so.6 No symbol table info available. #51 0x000055fdcda73045 in _start () No symbol table info available. ```
**Patch that works around the issue** ```diff diff --git a/libqnotero/qnoteroItemDelegate.py b/libqnotero/qnoteroItemDelegate.py index 373e167..26a9070 100644 --- a/libqnotero/qnoteroItemDelegate.py +++ b/libqnotero/qnoteroItemDelegate.py @@ -73,7 +73,7 @@ class QnoteroItemDelegate(QStyledItemDelegate): A QSize """ - return QSize(0, self.height) + return QSize(0, int(self.height)) def paint(self, painter, option, index): @@ -116,8 +116,8 @@ class QnoteroItemDelegate(QStyledItemDelegate): foreground = self.palette.WindowText # Draw the frame - _rect = option.rect.adjusted(self._margin, self._margin, - -2*self._margin, -self._margin) + _rect = option.rect.adjusted(int(self._margin), int(self._margin), + int(-2*self._margin), int(-self._margin)) pen = painter.pen() pen.setColor(self.palette.color(background)) painter.setPen(pen) @@ -130,16 +130,16 @@ class QnoteroItemDelegate(QStyledItemDelegate): # Draw icon _rect = QRect(option.rect) - _rect.moveBottom(_rect.bottom() + 0.5*self.dy) - _rect.moveLeft(_rect.left() + 0.5*self.dy) - _rect.setHeight(self.pixmapSize) - _rect.setWidth(self.pixmapSize) + _rect.moveBottom(int(_rect.bottom() + 0.5*self.dy)) + _rect.moveLeft(int(_rect.left() + 0.5*self.dy)) + _rect.setHeight(int(self.pixmapSize)) + _rect.setWidth(int(self.pixmapSize)) painter.drawPixmap(_rect, pixmap) # Draw the text painter.save() - _rect = option.rect.adjusted(self.pixmapSize+0.5*self.dy, 0.5*self.dy, - -self.dy, 0) + _rect = option.rect.adjusted(int(self.pixmapSize+0.5*self.dy), int(0.5*self.dy), + int(-self.dy), 0) f = [self.tagFont, self.italicFont, self.regularFont, self.boldFont] @@ -149,6 +149,6 @@ class QnoteroItemDelegate(QStyledItemDelegate): textRenderer.setHtml(itemText) painter.translate(_rect.topLeft()) textRenderer.documentLayout().draw(painter, context) - _rect = _rect.adjusted(0, self.dy, 0, 0) + _rect = _rect.adjusted(0, int(self.dy), 0, 0) painter.restore() ```
MayeulC commented 2 years ago

Slightly cleaner (IMO) patch:

diff --git a/libqnotero/qnoteroItemDelegate.py b/libqnotero/qnoteroItemDelegate.py
index 373e167..1e01ff1 100644
--- a/libqnotero/qnoteroItemDelegate.py
+++ b/libqnotero/qnoteroItemDelegate.py
@@ -47,17 +47,17 @@ class QnoteroItemDelegate(QStyledItemDelegate):
                self.tagFont = QFont()
                self.tagFont.setBold(True)
                self.tagFont.setPointSize(self.boldFont.pointSize() - 2)
-               self.dy = QFontMetrics(self.boldFont) \
+               self.dy = int(QFontMetrics(self.boldFont) \
                        .size(Qt.TextSingleLine, u"Dummy").height() \
-                       *self.qnotero.theme.lineHeight()
-               self.margin = 0.5*self.dy
-               self._margin = 0.1*self.dy
+                       *self.qnotero.theme.lineHeight())
+               self.margin = self.dy//2
+               self._margin = self.dy//10
                self.height = 5*self.dy+self._margin
                self.noPdfPixmap = self.qnotero.theme.pixmap(u"nopdf")
                self.pdfPixmap = self.qnotero.theme.pixmap(u"pdf")
                self.aboutPixmap = self.qnotero.theme.pixmap(u"about")
                self.notePixmap = self.qnotero.theme.pixmap(u"note")
-               self.pixmapSize = self.pdfPixmap.height()+0.5*self.dy
+               self.pixmapSize = int(self.pdfPixmap.height())+self.dy//2
                self.roundness = self.qnotero.theme.roundness()

        def sizeHint(self, option, index):
@@ -130,15 +130,15 @@ class QnoteroItemDelegate(QStyledItemDelegate):

                # Draw icon
                _rect = QRect(option.rect)
-               _rect.moveBottom(_rect.bottom() + 0.5*self.dy)
-               _rect.moveLeft(_rect.left() + 0.5*self.dy)
+               _rect.moveBottom(_rect.bottom() + self.dy//2)
+               _rect.moveLeft(_rect.left() + self.dy//2)
                _rect.setHeight(self.pixmapSize)
                _rect.setWidth(self.pixmapSize)
                painter.drawPixmap(_rect, pixmap)

                # Draw the text
                painter.save()
-               _rect = option.rect.adjusted(self.pixmapSize+0.5*self.dy, 0.5*self.dy,
+               _rect = option.rect.adjusted(self.pixmapSize+self.dy//2, self.dy//2,
                                                                         -self.dy, 0)

                f = [self.tagFont, self.italicFont, self.regularFont,
ealbiter commented 2 years ago

Thank you for reporting. The problem was that python 3.1 does not perform implicit casting from float to int.