Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt5 GUI fails to initialize on Kubuntu 19.10. Application broken #313

Closed
luziferius opened this issue Oct 21, 2019 · 1 comment
Closed
Assignees
Labels
autokey-qt bug upstream bug Bugs in autokey caused by issues in used libraries user interface Issues related to the user interface

Comments

@luziferius
Copy link
Collaborator

luziferius commented Oct 21, 2019

Classification:

Crash

Reproducibility:

Always

Version

AutoKey version: 0.95.7

Used GUI (Gtk, Qt, or both): Qt5

Installed via: GitHub attached packages

Linux Distribution: Kubuntu 19.10

PyQt5: 5.12.3+dfsg-2
Qt5: 5.12.4+dfsg-4ubuntu1
Python3: 3.7.5-1

Summary

Error message during initialization. AK does not work.

Steps to Reproduce (if applicable)

Just run autokey-qt

Actual Results

2019-10-21 18:15:22,432 DEBUG - root.Qt-GUI.CentralWidget - CentralWidget instance created.
2019-10-21 18:15:22,578 ERROR - root - Fatal error starting AutoKey: <built-in function connectSlotsByName> returned a result with an error set
AttributeError: __getattribute__

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/autokey/qtapp.py", line 132, in __init__
    self.configWindow = ConfigWindow(self)
  File "/usr/lib/python3/dist-packages/autokey/qtui/configwindow.py", line 44, in __init__
    self.setupUi(self)
  File "<string>", line 12, in setupUi
  File "/usr/lib/python3/dist-packages/autokey/qtui/centralwidget.py", line 40, in __init__
    self.setupUi(self)
  File "<string>", line 38, in setupUi
  File "/usr/lib/python3/dist-packages/autokey/qtui/phrasepage.py", line 34, in __init__
    self.setupUi(self)
  File "<string>", line 46, in setupUi
  File "/usr/lib/python3/dist-packages/autokey/qtui/settingswidget.py", line 40, in __init__
    self.hotkey_settings_dialog = HotkeySettingsDialog(self)
  File "/usr/lib/python3/dist-packages/autokey/qtui/dialogs/hotkeysettings.py", line 49, in __init__
    self.setupUi(self)
  File "<string>", line 58, in setupUi
SystemError: <built-in function connectSlotsByName> returned a result with an error set

Notes

The event monitor still works, but neither the GUI nor the expansion service actually work.

This is a high priority task, because it is broken completely after a distribution update, which will be rolled out automatically in the next few days for all non-LTS Ubuntu users.

  • This issue is somewhere located in the GUI resource loading mechanism.
    I tried running from the source tree and got the same error message. Thus it is not an incompatibility with the compiled resource file shipped in the Debian package, because the version run from the source does load the *.ui files directly from the disk. Thus the compiled resources can be ruled out as the culprit.

  • Both master and develop branches are affected.

  • Arch Linux seems to be not affected (based on watching the AUR comments), although it runs the newest stable versions. If it were an incompatibility in some upstream library, AK will be broken there too. But since it is not, this seems to be an issue with the version packaged in Ubuntu, maybe even caused by some Ubuntu-specific patches.

Web research results:

Several other projects faced similar issues:
3ll3d00d/beqdesigner#292
tohojo/flent#167
GNS3/gns3-gui#2819
Related mailing list thread: https://www.riverbankcomputing.com/pipermail/pyqt/2019-August/042003.html
This thread was resolved with »Should be fixed in tonight's snapshot.«.
GNS3/gns3-gui#2819 (comment)

This probably means PyQt5 verion 5.13.1 will fix this problem.

Because the just released Ubuntu 19.10 still ships PyQt5 5.12.3, this may result in the Qt5 GUI being broken for 6 months, unless Canonical pushes 5.13.1 to the repositories…

@luziferius luziferius added bug autokey-qt user interface Issues related to the user interface labels Oct 21, 2019
@luziferius luziferius added this to the Bugfix release 0.95.8 milestone Oct 21, 2019
@luziferius luziferius self-assigned this Oct 21, 2019
@luziferius luziferius added the upstream bug Bugs in autokey caused by issues in used libraries label Oct 23, 2019
@luziferius
Copy link
Collaborator Author

luziferius commented Oct 26, 2019

Ok, I found the incompatibility issue. It was caused by the usage of Python properties in one of the GUI classes. Refactoring the class to not use the Property mechanism fixes the crash.

It seems that the use of properties causes Python to access additional class attributes while loading and parsing the source code. It unfortunately accesses an attribute that is dynamically created by PyQt5 at a later stage and therefore unavailable at the time, thus causing connectSignalsByName() Qt5 function to fail.

I’ll push the refactoring and publish 0.95.8 later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autokey-qt bug upstream bug Bugs in autokey caused by issues in used libraries user interface Issues related to the user interface
Projects
None yet
Development

No branches or pull requests

1 participant