Closed ZeeD closed 1 year ago
I can't reproduce any issue with latest versions of Python and PySide (Python 3.11.3, PySide 6.5.2 on Windows 11). Could you please tell me more about your configuration or even better copy/paste tracebacks here?
Thanks
Hi. thanks for the comment now I'm not at my workstation, and I'll try to send additional details as soon as possible. In the meantime could you have a look at the related pr? I remembered I've done some analysis when I found the issue
Yes, I already have taken a look at PR #75 but I would prefer to begin by reproducing the issue.
$ python --version
Python 3.11.5
$ python -mvenv venv
$ . venv/bin/activate
(venv) $ pip install PySide6==6.5.0 PySide6-Addons==6.5.0 PySide6-Essentials==6.5.0 QtPy==2.3.1 PythonQwt==0.10.2
# ...
(venv) $ pip list
Package Version
------------------ -------
numpy 1.25.2
packaging 23.1
pip 23.2
PySide6 6.5.0
PySide6-Addons 6.5.0
PySide6-Essentials 6.5.0
PythonQwt 0.10.2
QtPy 2.3.1
setuptools 68.1.2
shiboken6 6.5.0
(venv) $ python -c 'from qwt import tests; tests.run()'
qt.dbus.integration: Could not connect "org.freedesktop.IBus" to globalEngineChanged(QString)
qt.dbus.integration: Could not connect "org.freedesktop.IBus" to globalEngineChanged(QString)
# click on the "bode demo" item
Traceback (most recent call last):
File "/tmp/venv/lib/python3.11/site-packages/qwt/tests/bodedemo.py", line 284, in <module>
tests.test_widget(BodeDemo, (640, 480))
File "/tmp/venv/lib/python3.11/site-packages/qwt/tests/__init__.py", line 242, in test_widget
widget = widget_class()
^^^^^^^^^^^^^^
File "/tmp/venv/lib/python3.11/site-packages/qwt/tests/bodedemo.py", line 201, in __init__
self.plot = BodePlot(self)
^^^^^^^^^^^^^^
File "/tmp/venv/lib/python3.11/site-packages/qwt/tests/bodedemo.py", line 92, in __init__
QwtPlot.__init__(self, *args)
File "/tmp/venv/lib/python3.11/site-packages/qwt/plot.py", line 304, in __init__
QFrame.__init__(self, parent)
TypeError: QwtPlotDict.__init__() takes 1 positional argument but 2 were given
Exception ignored in: <function QwtPlot.__del__ at 0x7fbe12ec8860>
Traceback (most recent call last):
File "/tmp/venv/lib/python3.11/site-packages/qwt/plot.py", line 365, in __del__
self.setAutoReplot(False)
File "/tmp/venv/lib/python3.11/site-packages/qwt/plot.py", line 1066, in setAutoReplot
self.__data.autoReplot = tf
^^^^^^^^^^^
AttributeError: 'BodePlot' object has no attribute '_QwtPlot__data'
(venv) $
FWIW: this issue is not happening with PySide
* version 6.5.2
Ok, FYI, the AttributeError: 'BodePlot' object has no attribute '_QwtPlot__data'
is just a symptom of the unexpected destruction of a QwtPlot object. I will have to handle this more explicitely/wisely to avoid users from being focused on this part of the traceback (see Issue #77).
Regarding the main issue here (TypeError: QwtPlotDict.__init__() takes 1 positional argument but 2 were given
), I think that it may be a PySide bug relative to multiple inheritance management. This has always been a tricky problem to solve for Python-Qt bindings (PySide and PyQt) accross the major versions of Qt.
...so would it be acceptable to state that upgrading PySide to v6.5.2 is a good solution for this issue?
uhm... ok... I just fear that any (possible even minor) upgrade of PySide or any other related package may broke this part. but at least with current combination of PySide, QtPy, and PythonQwt I don't have issues.
I'll do some tests before closing this issue, just to be sure that there is nothing to be done.
I was able to reproduce the original issue with PySide 6.5.0 on Windows. This fix has been successfully tested on PySide 6.5.0, PySide 6.5.2 and PyQt5.
I'm using
Python
3.11.2
,PySide6
,PySide6-Addons
, andPySide6-Essentials
6.5.0
,QtPy
2.3.1
, andPythonQwt
0.10.2
(i.e. the current version of the packages)
and I'm facing errors. Even with the tests (
from qwt import tests; tests.run()
) I got a bunch of plots not working, and in the logs I have errors ending withAttributeError: 'BodePlot' object has no attribute '_QwtPlot__data'