summaryrefslogtreecommitdiff
path: root/hplip-add-ppd-crash.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-05 02:45:17 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-05 02:45:17 +0000
commit92ff4cdf8c84e91584dd6076aa5b3c774ab0a622 (patch)
tree6ba01d84d85f00b380477077d920c341c3570b09 /hplip-add-ppd-crash.patch
parentd8ce4006ffe8011c16c265205aa330c52a0de0c1 (diff)
automatic import of hplipopeneuler24.03_LTS
Diffstat (limited to 'hplip-add-ppd-crash.patch')
-rw-r--r--hplip-add-ppd-crash.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/hplip-add-ppd-crash.patch b/hplip-add-ppd-crash.patch
new file mode 100644
index 0000000..7117860
--- /dev/null
+++ b/hplip-add-ppd-crash.patch
@@ -0,0 +1,31 @@
+diff --git a/setup.py b/setup.py
+index 976a42c..3604dd7 100755
+--- a/setup.py
++++ b/setup.py
+@@ -558,6 +558,9 @@ else: # INTERACTIVE_MODE
+
+ if file_path.endswith('.gz'):
+ nickname = gzip.GzipFile(file_path, 'r').read(4096)
++ if sys.version_info[0] > 2:
++ nickname = nickname.decode('utf-8')
++
+ else:
+ nickname = open(file_path, 'r').read(4096)
+
+diff --git a/ui5/setupdialog.py b/ui5/setupdialog.py
+index ac45357..a6dacf0 100644
+--- a/ui5/setupdialog.py
++++ b/ui5/setupdialog.py
+@@ -772,9 +772,9 @@ class SetupDialog(QDialog, Ui_Dialog):
+
+
+ def OtherPPDButton_clicked(self, b):
+- ppd_file = to_unicode(QFileDialog.getOpenFileName(self, self.__tr("Select PPD File"),
+- sys_conf.get('dirs', 'ppd'),
+- self.__tr("PPD Files (*.ppd *.ppd.gz);;All Files (*)")))
++ ppd_file = QFileDialog.getOpenFileName(self, self.__tr("Select PPD File"),
++ sys_conf.get('dirs', 'ppd'),
++ self.__tr("PPD Files (*.ppd *.ppd.gz);;All Files (*)"))[0]
+
+ if ppd_file and os.path.exists(ppd_file):
+ self.print_ppd = (ppd_file, cups.getPPDDescription(ppd_file))