Blame SOURCES/hplip-add-ppd-crash.patch

7a2b19
diff --git a/setup.py b/setup.py
7a2b19
index 976a42c..3604dd7 100755
7a2b19
--- a/setup.py
7a2b19
+++ b/setup.py
7a2b19
@@ -558,6 +558,9 @@ else: # INTERACTIVE_MODE
7a2b19
 
7a2b19
                             if file_path.endswith('.gz'):
7a2b19
                                 nickname = gzip.GzipFile(file_path, 'r').read(4096)
7a2b19
+                                if sys.version_info[0] > 2:
7a2b19
+                                    nickname = nickname.decode('utf-8')
7a2b19
+
7a2b19
                             else:
7a2b19
                                 nickname = open(file_path, 'r').read(4096)
7a2b19
 
7a2b19
diff --git a/ui5/setupdialog.py b/ui5/setupdialog.py
7a2b19
index ac45357..a6dacf0 100644
7a2b19
--- a/ui5/setupdialog.py
7a2b19
+++ b/ui5/setupdialog.py
7a2b19
@@ -772,9 +772,9 @@ class SetupDialog(QDialog, Ui_Dialog):
7a2b19
 
7a2b19
 
7a2b19
     def OtherPPDButton_clicked(self, b):
7a2b19
-        ppd_file = to_unicode(QFileDialog.getOpenFileName(self, self.__tr("Select PPD File"),
7a2b19
-                                                       sys_conf.get('dirs', 'ppd'),
7a2b19
-                                                       self.__tr("PPD Files (*.ppd *.ppd.gz);;All Files (*)")))
7a2b19
+        ppd_file = QFileDialog.getOpenFileName(self, self.__tr("Select PPD File"),
7a2b19
+                                                sys_conf.get('dirs', 'ppd'),
7a2b19
+                                                self.__tr("PPD Files (*.ppd *.ppd.gz);;All Files (*)"))[0]
7a2b19
 
7a2b19
         if ppd_file and os.path.exists(ppd_file):
7a2b19
             self.print_ppd = (ppd_file, cups.getPPDDescription(ppd_file))