SHA256
1
0
forked from printing/hplip
Files
hplip/hplip-base-Fix-Found-No-Section-error-with-python-2..patch

39 lines
1.6 KiB
Diff
Raw Permalink Normal View History

Update to HPLIP 3.25.8 Added support for the following new Printers * HP LaserJet Enterprise Flow MFP 8601z * HP LaserJet Enterprise 5501 * HP LaserJet Enterprise MFP 5601dn * HP LaserJet Enterprise 6500dn * HP LaserJet Enterprise 5501n * HP LaserJet Enterprise MFP 5601 * HP LaserJet Enterprise 6500 * HP LaserJet Enterprise 5502dn * HP LaserJet Enterprise MFP 5602dn * HP LaserJet Enterprise 6500n * HP LaserJet Enterprise 5502 * HP LaserJet Enterprise MFP 5602f * HP LaserJet Enterprise 6501dn * HP LaserJet Enterprise X50452dn * HP LaserJet Enterprise Flow MFP 5602zfw * HP LaserJet Enterprise 6501 * HP LaserJet Enterprise X50452 * HP LaserJet Enterprise MFP 5602 * HP LaserJet Enterprise X60257dn * HP LaserJet Enterprise MFP X53052dn * HP LaserJet Enterprise Flow MFP X530 * HP LaserJet Enterprise X60257 * HP LaserJet Enterprise MFP X53052 * HP LaserJet Enterprise X60357dn * HP LaserJet Enterprise X60357 * HP LaserJet Enterprise MFP 6600dn * HP LaserJet Enterprise Flow MFP 6600zfw * HP LaserJet Enterprise MFP 6600 * HP LaserJet Enterprise Flow MFP 6600zfsw * HP LaserJet Enterprise MFP X62757dn * HP LaserJet Enterprise Flow MFP X62757zs * HP LaserJet Enterprise MFP X62757 * DEX D50452dn * DEX MFP D53052dn Drop patches that have been merged upstream * Drop hplip-change-pgp-server.patch * Drop hp-setup-fix-python-crash-when-manually-importing-gz.patch Fix handling of readfp() and read_filke() for ConfigParser objects, avoiding confusing error messages (lp#2139771) * Add hplip-fix-handling-of-ConfigParser-.readfp-vs.-read_.patch * Drop hplip-base-replace-f-string-with-string.format-for-p.patch Fix compiler warnings on SLE15 * Add Fix-two-compiler-warnings-that-cause-build-failure-o.patch Renamed patch files to achieve a consistent patch naming according to the rules of git-format-patch * Rename change-udev-rules.diff -> hplip-change-udev-rules.patch * Rename disable_hp-upgrade.patch -> disable-hp-upgrade.patch * Rename add_missing_includes_and_define_GNU_SOURCE.patch -> add-missing-includes-and-define-GNU_SOURCE.patch * Rename hplip-remove-imageprocessor.diff -> hplip-remove-imageprocessor.patch * Rename hplip-orblite-return-null.diff -> hplip-orblite-return-null.patch * Rename hplip-hpaio-gcc14.patch -> hplip-hpaio-avoid-C99-violations.patch * Rename hplip-no-urlopener.patch -> URLopener-was-removed-in-Python-3.14-and-hplip-trace.patch * Rename hplip-3.24.4-gcc15.patch -> hplip-sane-fix-compilation-with-gcc-15.patch Patches are now managed under https://github.com/mwilck/hplip
2026-02-03 20:51:10 +01:00
From 6ea289207f5805085bbe36f6e5d4cdb262717e02 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Thu, 23 Jan 2025 16:47:10 +0100
Subject: [PATCH 30/33] hplip/base: Fix "Found No Section" error with python
2.7.13
See https://bugs.launchpad.net/hplip/+bug/2095776
---
base/g.py | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/base/g.py b/base/g.py
index 123c73e..e659213 100644
--- a/base/g.py
+++ b/base/g.py
@@ -137,8 +137,17 @@ class ConfigBase(object):
except Exception as e:
log.error(f"Reading file with read_file also failed. Error: {e}")
except configparser.MissingSectionHeaderError:
- print("")
- log.error("Found No Section in %s. Please set the http proxy for root and try again." % self.filename)
+ fp.close()
+ # Workaround for lp#2095776: skip leading whitespace in plugin.conf
+ from StringIO import StringIO
+ t0 = open(self.filename, "r").read()
+ t0 = t0[t0.find("["): -1]
+ fp = StringIO(t0)
+ try:
+ self.conf.readfp(fp)
+ except Exception as e:
+ print("")
+ log.error("Found No Section in %s. Please set the http proxy for root and try again." % self.filename)
except (configparser.DuplicateOptionError):
log.warn("Found Duplicate Entery in %s" % self.filename)
self.CheckDuplicateEntries()
--
2.52.0