Skip to content

qtvcp: fix undefined name in gcode_editor QScintilla import fallback#4182

Open
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:fix/gcode-editor-undefined-e
Open

qtvcp: fix undefined name in gcode_editor QScintilla import fallback#4182
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:fix/gcode-editor-undefined-e

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

The PyQt5 branch of the QScintilla import fallback in gcode_editor.py caught ImportError without binding it (as e), then passed exc_info=e to LOG.critical, raising NameError. Since qtvcp installs a modal-dialog sys.excepthook at startup, that turns a missing python3-pyqt5.qsci into an indefinite hang under headless/CI (the dialog blocks forever, the GUI never reaches its event loop or honors SIGTERM) instead of a clean exit.

Fix binds the exception and sys.exit(1), matching the PyQt6 branch below it.

Verified on Fedora 43 / Python 3.14.5 with python3-qscintilla-qt5 removed: before, qtdragon-quit hangs (GUI still alive 15s after SIGTERM); after, it logs the actionable message and exits in ~6s.

The PyQt5 branch of the QScintilla import fallback caught ImportError
without binding it (no 'as e') but then passed exc_info=e to LOG.critical,
raising NameError. Because sys.excepthook is installed at qtvcp startup and
pops a modal error dialog, that NameError turns a missing python3-pyqt5.qsci
into an indefinite hang (the dialog blocks forever under headless/CI) instead
of a clean exit.

Bind the exception as e and sys.exit(1), matching the PyQt6 branch below.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant