Method readfp() of configparser class is removed in Python 3.12
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
HPLIP |
New
|
Undecided
|
Unassigned | ||
hplip (Fedora) |
Unknown
|
Unknown
|
Bug Description
Python 3.12 removed readfp() method, so all hplip tools/binaries give traceback, f.e.:
$ sudo /usr/lib/
/usr/share/
spinner = "\|/-\|/-"
/usr/share/
m = re.search(
/usr/share/
elem_start = re.findall(
/usr/share/
elem_finished = re.findall(
/usr/share/
attrs = re.findall(
Traceback (most recent call last):
File "/usr/lib/
from base.g import *
File "/usr/share/
sys_conf = SysConfig()
File "/usr/share/
ConfigBase.
File "/usr/share/
self.read()
File "/usr/share/
self.
^^^
AttributeError: 'ConfigParser' object has no attribute 'readfp'. Did you mean: 'read'?
I've switched the code to 'read_file(fp, self.filename)', which fixes it.
Patch attached.