From 92ff4cdf8c84e91584dd6076aa5b3c774ab0a622 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 5 Aug 2024 02:45:17 +0000 Subject: automatic import of hplip --- hplip-add-ppd-crash.patch | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 hplip-add-ppd-crash.patch (limited to 'hplip-add-ppd-crash.patch') 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)) -- cgit v1.2.3