Bug 2028697 - hp-setup trackbacks when hplip-gui RPM is not installed
Summary: hp-setup trackbacks when hplip-gui RPM is not installed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: hplip
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zdenek Dohnal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-02 23:50 UTC by Peter Janes
Modified: 2021-12-12 01:05 UTC (History)
4 users (show)

Fixed In Version: hplip-3.21.2-15.fc35 hplip-3.21.2-15.fc34
Clone Of:
Environment:
Last Closed: 2021-12-07 02:06:18 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Peter Janes 2021-12-02 23:50:58 UTC
Description of problem:
hp-setup fails with a Python traceback, ending with "ModuleNotFoundError: No module named 'ui5'"


Version-Release number of selected component (if applicable):
hplip-3.21.2-13.fc35.x86_64

How reproducible: 100%


Steps to Reproduce:
1. Install hplip
2. Execute hp-setup
3.

Actual results:
$ hp-setup 

HP Linux Imaging and Printing System (ver. 3.21.2)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Traceback (most recent call last):
  File "/usr/bin/hp-setup", line 313, in <module>
    ui = import_module(ui_package + ".setupdialog")
  File "/usr/lib64/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'ui5'


Expected results:


Additional info:
Previous duplicates include bug 1368737, bug 1530331, bug 1794147; the latter (apparently fixed in Fedora 32) says it should report "error: Install the hplip-gui package for graphical support." but that doesn't happen.

Comment 1 Zdenek Dohnal 2021-12-03 07:07:10 UTC
Hi Peter,

thank you for reporting the issue!

HP tools uses import_dialog() function for checking for GUI. However the function lives in base/utils.py which is a different dir level than where ui5 module is, so the function uses indirect import like:

import ui5

which has a downside - IMO it looks everywhere in python module search path, so it can load other module than you expect - which happened this time. But of course this module doesn't have classes which HP script expects, so it fails later.

The proper fix would be to move the function to the same level as ui5 module, but since upstream is rarely responsive, I'll work it around by importing some class from ui5 module...

Comment 2 Zdenek Dohnal 2021-12-03 07:29:11 UTC
FYI the current hplip will show error message if hplip-gui is not installed and automatically switches to interactive mode.

Comment 3 Fedora Update System 2021-12-03 08:23:02 UTC
FEDORA-2021-08c10ee211 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-08c10ee211

Comment 4 Fedora Update System 2021-12-03 08:58:57 UTC
FEDORA-2021-ce9bb5d10b has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-ce9bb5d10b

Comment 5 Fedora Update System 2021-12-04 01:23:40 UTC
FEDORA-2021-08c10ee211 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-08c10ee211`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-08c10ee211

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2021-12-04 02:16:53 UTC
FEDORA-2021-ce9bb5d10b has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-ce9bb5d10b`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-ce9bb5d10b

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2021-12-07 02:06:18 UTC
FEDORA-2021-08c10ee211 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2021-12-12 01:05:01 UTC
FEDORA-2021-ce9bb5d10b has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.