hplip-1_3_23_12-4-python3_12-fix.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From eb5e88152538a36e74ea8d7085a54baf48e06103 Mon Sep 17 00:00:00 2001
  2. From: Zdenek Dohnal <zdohnal@redhat.com>
  3. Date: Jul 17 2023 16:43:31 +0000
  4. Subject: 2221311 - [python3.12] hplip tools/binaries crash due depending on removed configparser.readfp()
  5. ---
  6. diff --git a/base/g.py b/base/g.py
  7. index 0aa0e2e..96b3131 100644
  8. --- a/base/g.py
  9. +++ b/base/g.py
  10. @@ -128,7 +128,7 @@ class ConfigBase(object):
  11. try:
  12. fp = open(self.filename, "r")
  13. try:
  14. - self.conf.readfp(fp)
  15. + self.conf.read_file(fp, self.filename)
  16. except configparser.MissingSectionHeaderError:
  17. print("")
  18. log.error("Found No Section in %s. Please set the http proxy for root and try again." % self.filename)
  19. diff --git a/ui5/devmgr5.py b/ui5/devmgr5.py
  20. index 3110a0f..3761f89 100644
  21. --- a/ui5/devmgr5.py
  22. +++ b/ui5/devmgr5.py
  23. @@ -1072,7 +1072,7 @@ class DevMgr5(Ui_MainWindow_Derived, Ui_MainWindow, QMainWindow):
  24. hplip_conf = configparser.ConfigParser()
  25. fp = open("/etc/hp/hplip.conf", "r")
  26. - hplip_conf.readfp(fp)
  27. + hplip_conf.read_file(fp, "/etc/hp/hplip.conf")
  28. fp.close()
  29. try:
  30. try: