Bug#1095321: hplip-gui fails to start
Control: tags -1 +patch
On Fri, Feb 07, 2025 at 07:25:02AM +0100, Michele Cane wrote:
> Package: hplip-gui
> Version: 3.22.10+dfsg0-6
> Severity: important
>
> Dear Maintainer,
>
> hplip-gui fails to start with the message below this only since the latest version 3.22.10+dfsg0-6
...
> File "/usr/share/hplip/ui5/devmgr5.py", line 1075, in updateActionsTab
> hplip_conf.readfp(fp)
> ^^^^^^^^^^^^^^^^^
> AttributeError: 'ConfigParser' object has no attribute 'readfp'. Did you mean: 'read'?
> Aborted
Hi,
Seems that not all python12 fixes, that were included in
hplip_3.22.10+dfsg0-5.1 NMU by Tianyu Chen, were preserved
in hplip_3.22.10+dfsg0-6. Just one fix affecting package
build was preserved. Mentioned NMU was uploaded to fix
https://bugs.debian.org/1075760 [hplip-gui breaks with python 3.12]
I am attaching a diff with patch by Tianyu Chen, modified to not
include the change already present in hplip_3.22.10+dfsg0-6.
--
Agustin
Description: Use read_file instead of readfp for python 3.12
Author: Tianyu Chen <sweetyfish@deepin.org>
Bug-Debian: https://bugs.debian.org/1075760
Forwarded: no
Last-Update: 2024-07-09
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/ui/devmgr4.py
+++ b/ui/devmgr4.py
@@ -1227,7 +1227,7 @@ class DevMgr4(DevMgr4_base):
hplip_conf = ConfigParser.ConfigParser()
fp = open("/etc/hp/hplip.conf", "r")
- hplip_conf.readfp(fp)
+ hplip_conf.read_file(fp)
fp.close()
try:
--- a/ui4/devmgr5.py
+++ b/ui4/devmgr5.py
@@ -1024,7 +1024,7 @@ class DevMgr5(QMainWindow, Ui_MainWindo
hplip_conf = configparser.ConfigParser()
fp = open("/etc/hp/hplip.conf", "r")
- hplip_conf.readfp(fp)
+ hplip_conf.read_file(fp)
fp.close()
try:
--- a/ui5/devmgr5.py
+++ b/ui5/devmgr5.py
@@ -1072,7 +1072,7 @@ class DevMgr5(Ui_MainWindow_Derived, Ui_
hplip_conf = configparser.ConfigParser()
fp = open("/etc/hp/hplip.conf", "r")
- hplip_conf.readfp(fp)
+ hplip_conf.read_file(fp)
fp.close()
try:
Reply to: