hplip/hplip-use-binary-str.patch
Petr Šabata 3b7ae335f3 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/hplip#7cb6f648cdb35a0f018b511d10b516d6d9e4d638
2020-10-15 12:26:13 +02:00

41 lines
1.6 KiB
Diff

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])