Nuitka: PySide6: Widget Connections crashing exe
-
Please check out if the develop version of Nuitka works better for you. Why, how different is it likely to be to 1.8.2 ?
-
Nuitka version, full Python version, flavor, OS, etc. as output by this exact command. (.venv) C:\git\PathOfBuilding-Python>python -m nuitka --version 1.8.2 Commercial: None Python: 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] Flavor: CPython Official Executable: C:\git\PathOfBuilding-Python.venv\Scripts\python.exe OS: Windows Arch: x86_64 WindowsRelease: 10 Version C compiler: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\bin\Hostx64\x64\cl.exe (cl 14.3).
-
How did you install Nuitka and Python python-3.11.5-amd64.exe, full install for everyone, including adding to PATH poetry install poetry shell pip install Nuitka
-
The specific PyPI names and versions (.venv) C:\git\PathOfBuilding-Python>python -m pip freeze astroid==2.15.6 attrs==23.1.0 black==22.12.0 build==0.10.0 CacheControl==0.13.1 certifi==2023.7.22 charset-normalizer==3.2.0 cleo==2.0.1 click==8.1.7 colorama==0.4.6 crashtest==0.4.1 dill==0.3.7 distlib==0.3.7 dulwich==0.21.6 filelock==3.12.4 idna==3.4 importlib-metadata==6.8.0 installer==0.7.0 isort==5.12.0 jaraco.classes==3.3.0 jsonschema==4.17.3 keyring==24.2.0 lazy-object-proxy==1.9.0 luadata==1.0.5 mccabe==0.7.0 more-itertools==10.1.0 msgpack==1.0.5 mypy-extensions==1.0.0 Nuitka==1.8.2 numpy==1.26.0 ordered-set==4.1.0 packaging==23.1 pathspec==0.11.2 pexpect==4.8.0 pkginfo==1.9.6 platformdirs==3.10.0 poetry==1.6.1 poetry-core==1.7.0 poetry-plugin-export==1.5.0 psutil==5.9.5 ptyprocess==0.7.0 pylint==2.17.5 pyperclip==1.8.2 pyproject_hooks==1.0.0 PyQt6==6.5.2 PyQt6-Qt6==6.5.2 PyQt6-sip==13.5.2 pyrsistent==0.19.3 PySide6==6.5.2 PySide6-Addons==6.5.2 PySide6-Essentials==6.5.2 pywin32-ctypes==0.2.2 rapidfuzz==3.3.0 requests==2.31.0 requests-toolbelt==1.0.0 rpds-py==0.10.3 shellingham==1.5.3 shiboken6==6.5.2 six==1.16.0 SLPP==1.2.3 tomlkit==0.12.1 trove-classifiers==2023.8.7 urllib3==2.0.4 virtualenv==20.24.5 wrapt==1.15.0 xmltodict==0.13.0 zipp==3.16.2 zstandard==0.21.0
-
Many times when you get an error from Nuitka, your setup may be special
Executable is created, simple MRE may not assist here
- Also supply a Short, Self Contained, Correct, Example
A simple MRE may not assist here. I’m not sure how I could go about that, given it’s part of a project. I do understand you’d like it simple, but I can’t see how
I don’t expect you to compile it, just want you to see how things are used. https://github.com/pHiney/PathOfBuilding-Python
- Provide in your issue the Nuitka options used
# nuitka-project: --onefile
# nuitka-project: --standalone
# nuitka-project: --onefile-windows-splash-screen-image=Assets/PathOfBuilding.png
# nuitka-project: --enable-plugin=pyside6
# nuitka-project: --include-data-dir=src/data=data
# nuitka-project: --windows-icon-from-ico=Assets/Icons/PathOfBuilding.ico
# nuitka-project: --onefile-tempdir-spec="%TEMP%/PoB_%PID%"
# nuitka-project: --onefile-no-compression
# nuitka-project: --include-plugin-directory=src/dialogs
# nuitka-project: --clean-cache=all
-
Note if this is a regression No Idea.
-
Consider getting commercial support No. This is an open source project
-
Actual Issue When run as an executable on Windows, opening the Open File dialog (Ctrl-O) cause the executable to crash and exit with no message. Running the program using “python PathOfBuilding.py” does not crash.
The offending lines are (line 81-84 browse_file_dialog.py
self.list_Files.itemClicked.connect(self.list_file_clicked)
self.list_Files.itemDoubleClicked.connect(self.list_file_double_clicked)
self.lineEdit_CurrDir.textChanged.connect(self.lineedit_currdir_changed)
self.lineEdit_CurrDir.editingFinished.connect(self.lineedit_currdir_editing_finished)
It doesn’t matter which ones are present or commented out. They all cause the crash. If the four lines are commented out, no crash but not much functionality either.
Output when run from executable. Note the PySide6 and connect errors.
(.venv) c:\_complete\_new>PathOfBuilding.exe
2023-09-20 22:23:47.621989. Path of Building, running on Windows 10; 10.0.22621
Loading Tree: 3.22
2023-09-20 22:23:49.433824: ('add_tree_images, full_clear=True',) : File "C:\Users\Peter\AppData\Local\Temp\POB_21~1\widgets\tree_view.py", line 335, in add_tree_images
QGraphicsScene::addItem: cannot add null item
2023-09-20 22:23:49.583788: ('add_tree_images, full_clear=False',) : File "C:\Users\Peter\AppData\Local\Temp\POB_21~1\widgets\tree_view.py", line 335, in add_tree_images
QGraphicsScene::removeItem: cannot remove 0-item
QGraphicsScene::addItem: cannot add null item
2023-09-20 22:23:49.588323: ('add_tree_images, full_clear=False',) : File "C:\Users\Peter\AppData\Local\Temp\POB_21~1\widgets\tree_view.py", line 335, in add_tree_images
QGraphicsScene::removeItem: cannot remove 0-item
QGraphicsScene::addItem: cannot add null item
Traceback (most recent call last):
File "C:\Users\Peter\AppData\Local\Temp\POB_21~1\widgets\skills_ui.py", line 717, in change_socket_group
File "C:\Users\Peter\AppData\Local\Temp\POB_21~1\widgets\skills_ui.py", line 760, in load_socket_group
File "C:\Users\Peter\AppData\Local\Temp\POB_21~1\widgets\skills_ui.py", line 333, in connect_skill_triggers
File "C:\Users\Peter\AppData\Local\Temp\POB_21~1\PySide6\QtCore-postLoad.py", line 12, in patched_connect
TypeError: 'PySide6.QtCore.QObject.connect' called with wrong argument types:
PySide6.QtCore.QObject.connect(ListBox, str, compiled_frame, ConnectionType)
Supported signatures:
PySide6.QtCore.QObject.connect(PySide6.QtCore.QObject, bytes, Callable, PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection))
PySide6.QtCore.QObject.connect(bytes, Callable, PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection))
PySide6.QtCore.QObject.connect(bytes, PySide6.QtCore.QObject, bytes, PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection))
PySide6.QtCore.QObject.connect(PySide6.QtCore.QObject, bytes, bytes, PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection))
PySide6.QtCore.QObject.connect(PySide6.QtCore.QObject, PySide6.QtCore.QMetaMethod, PySide6.QtCore.QObject, PySide6.QtCore.QMetaMethod, PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection))
PySide6.QtCore.QObject.connect(PySide6.QtCore.QObject, bytes, PySide6.QtCore.QObject, bytes, PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection))
2023-09-20 22:23:49.676071: ('add_tree_images, full_clear=True',) : File "C:\Users\Peter\AppData\Local\Temp\POB_21~1\widgets\tree_view.py", line 335, in add_tree_images
QGraphicsScene::addItem: cannot add null item
Output from running as python from the command line. Not all the QGraphicsScene still exist (still to be solved) so not relevant. The pyside and connect errors are not present.
(.venv) C:\git\PathOfBuilding-Python\src>python PathOfBuilding.py
2023-09-20 22:30:53.456320. Path of Building, running on Windows 10; 10.0.22621
Loading Tree: 3.22
2023-09-20 22:30:55.048993: ('add_tree_images, full_clear=True',) : File "C:\git\PathOfBuilding-Python\src\widgets\tree_view.py", line 335, in add_tree_images
QGraphicsScene::addItem: cannot add null item
2023-09-20 22:30:55.266608: ('add_tree_images, full_clear=False',) : File "C:\git\PathOfBuilding-Python\src\widgets\tree_view.py", line 335, in add_tree_images
QGraphicsScene::removeItem: cannot remove 0-item
QGraphicsScene::addItem: cannot add null item
2023-09-20 22:30:55.268128: ('add_tree_images, full_clear=False',) : File "C:\git\PathOfBuilding-Python\src\widgets\tree_view.py", line 335, in add_tree_images
QGraphicsScene::removeItem: cannot remove 0-item
QGraphicsScene::addItem: cannot add null item
2023-09-20 22:30:55.321534: ('add_tree_images, full_clear=True',) : File "C:\git\PathOfBuilding-Python\src\widgets\tree_view.py", line 335, in add_tree_images
QGraphicsScene::addItem: cannot add null item
Thanks in Advance pH
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Comments: 43 (17 by maintainers)
For a MRE
Grab the five files from https://github.com/pHiney/PathOfBuilding-Python/tree/dev/scripts/tests/connections.MRE
I can run it as “c:\Temp> python connections.MRE\connections.py” outside of my main environment, with only the addition of PySide6 to the main python install, and it runs correctly.
When it is run after building an .exe it stops on
To fail the program: Open the menu and select an item, it opens the file dialog - double click on a sub directory to open it. Program fails.
Question: Is it that I disconnect and reconnect triggers to stop trigger storms (tho this simple example may not, other screens do) - so you aren’t tracking disconnects.
I commented out line line 162 of browse_file_dialog.py and the program behaves normally, when it is run as an .exe.
pH
This with a space in there will be ignored, but looks pretty good to me. The reproducer is shockingly simple. My guess is that matching string literals produces something random. Not freelist related at all maybe, I only need
--debugas an option.