From 784addac2c0cb82d323c953ea2354e976088dc57 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Thu, 3 Dec 2009 14:59:37 +0000 Subject: [PATCH] - Handle RuntimeError when localizing state reason (bug #543937). --- system-config-printer-localize-statereason.patch | 12 ++++++++++++ system-config-printer.spec | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 system-config-printer-localize-statereason.patch diff --git a/system-config-printer-localize-statereason.patch b/system-config-printer-localize-statereason.patch new file mode 100644 index 0000000..50be477 --- /dev/null +++ b/system-config-printer-localize-statereason.patch @@ -0,0 +1,12 @@ +diff -up system-config-printer-1.1.15/statereason.py.localize-statereason system-config-printer-1.1.15/statereason.py +--- system-config-printer-1.1.15/statereason.py.localize-statereason 2009-11-30 12:43:08.000000000 +0000 ++++ system-config-printer-1.1.15/statereason.py 2009-12-03 14:57:17.285051607 +0000 +@@ -138,7 +138,7 @@ class StateReason: + reason = localized_reason[:-2] + else: + reason = self.get_reason() +- except cups.IPPError: ++ except (cups.IPPError, RuntimeError): + reason = self.get_reason() + + text = _("Printer '%s': '%s'.") % (self.get_printer (), reason) diff --git a/system-config-printer.spec b/system-config-printer.spec index 61da0d5..05d7d1c 100644 --- a/system-config-printer.spec +++ b/system-config-printer.spec @@ -7,7 +7,7 @@ Summary: A printer administration tool Name: system-config-printer Version: 1.1.15 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: http://cyberelk.net/tim/software/system-config-printer/ Group: System Environment/Base @@ -16,6 +16,7 @@ Source1: http://cyberelk.net/tim/data/pycups/pycups-%{pycups_version}.tar.bz2 Source2: http://cyberelk.net/tim/data/pysmbc/pysmbc-%{pysmbc_version}.tar.bz2 Patch1: system-config-printer-no-epydoc.patch +Patch2: system-config-printer-localize-statereason.patch BuildRequires: cups-devel >= 1.2 BuildRequires: python-devel >= 2.4 @@ -76,6 +77,7 @@ printers. %prep %setup -q -a 1 -a 2 %patch1 -p1 -b .no-epydoc +%patch2 -p1 -b .localize-statereason %build %configure --with-udev-rules --with-polkit-1 @@ -188,6 +190,9 @@ rm -rf %buildroot exit 0 %changelog +* Thu Dec 3 2009 Tim Waugh - 1.1.15-2 +- Handle RuntimeError when localizing state reason (bug #543937). + * Mon Nov 30 2009 Tim Waugh 1.1.15-1 - 1.1.15: - Fixed traceback introduced by fix to bug #541882.