diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-05 02:45:17 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-05 02:45:17 +0000 |
commit | 92ff4cdf8c84e91584dd6076aa5b3c774ab0a622 (patch) | |
tree | 6ba01d84d85f00b380477077d920c341c3570b09 /hplip-use-binary-str.patch | |
parent | d8ce4006ffe8011c16c265205aa330c52a0de0c1 (diff) |
automatic import of hplipopeneuler24.03_LTS
Diffstat (limited to 'hplip-use-binary-str.patch')
-rw-r--r-- | hplip-use-binary-str.patch | 40 |
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]) + |