hplip/hplip-add-ppd-crash.patch

32 lines
1.4 KiB
Diff
Raw Normal View History

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