summaryrefslogtreecommitdiff
path: root/hplip-add-ppd-crash.patch
diff options
context:
space:
mode:
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))