summaryrefslogtreecommitdiff
path: root/hplip-use-binary-str.patch
diff options
context:
space:
mode:
Diffstat (limited to 'hplip-use-binary-str.patch')
-rw-r--r--hplip-use-binary-str.patch40
1 files changed, 40 insertions, 0 deletions
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])
+