From 05f6fb34ee79ee8112ef549e93f0a138be0e2abf Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Thu, 1 Aug 2024 15:40:13 +0000 Subject: automatic import of hplip --- hplip-use-binary-str.patch | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 hplip-use-binary-str.patch (limited to 'hplip-use-binary-str.patch') diff --git a/hplip-use-binary-str.patch b/hplip-use-binary-str.patch new file mode 100644 index 0000000..319f1d6 --- /dev/null +++ b/hplip-use-binary-str.patch @@ -0,0 +1,40 @@ +diff -up hplip-3.18.5/base/utils.py.use-binary-str hplip-3.18.5/base/utils.py +--- hplip-3.18.5/base/utils.py.use-binary-str 2018-05-28 13:52:32.698082273 +0200 ++++ hplip-3.18.5/base/utils.py 2018-05-28 13:53:20.563707314 +0200 +@@ -961,10 +961,7 @@ else: + + + def printable(s): +- if s: +- return s.translate(identity, unprintable) +- else: +- return "" ++ return s.translate(identity, unprintable) + + + def any(S,f=lambda x:x): +diff -up hplip-3.18.5/fax/pmlfax.py.use-binary-str hplip-3.18.5/fax/pmlfax.py +--- hplip-3.18.5/fax/pmlfax.py.use-binary-str 2018-05-24 06:34:40.000000000 +0200 ++++ hplip-3.18.5/fax/pmlfax.py 2018-05-28 13:52:05.752293151 +0200 +@@ -143,8 +143,8 @@ class PMLFaxDevice(FaxDevice): + + def getPhoneNum(self): + if PY3: +- data = utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1]) +- return data ++ data = utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1].encode('utf-8')) ++ return data.decode('utf-8') + else: + return utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1]) + phone_num = property(getPhoneNum, setPhoneNum, doc="OID_FAX_LOCAL_PHONE_NUM") +@@ -155,8 +155,8 @@ class PMLFaxDevice(FaxDevice): + + def getStationName(self): + if PY3: +- data = utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1]) +- return data ++ data = utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1].encode('utf-8')) ++ return data.decode('utf-8') + else: + return utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1]) + -- cgit v1.2.3