rpms/system-config-printer/F-11 system-config-printer-asyncipp-traceback.patch, NONE, 1.1 system-config-printer.spec, 1.354, 1.355

Tim Waugh twaugh at fedoraproject.org
Fri Mar 26 14:16:17 UTC 2010


Author: twaugh

Update of /cvs/pkgs/rpms/system-config-printer/F-11
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv28220

Modified Files:
	system-config-printer.spec 
Added Files:
	system-config-printer-asyncipp-traceback.patch 
Log Message:
* Fri Mar 26 2010 Tim Waugh <twaugh at redhat.com> - 1.1.18-6
- Fixed traceback in asyncipp (bug #576932).


system-config-printer-asyncipp-traceback.patch:
 asyncipp.py |   20 ++++++++++++--------
 asyncpk0.py |    9 +++++++++
 asyncpk1.py |   14 ++++++++++++++
 3 files changed, 35 insertions(+), 8 deletions(-)

--- NEW FILE system-config-printer-asyncipp-traceback.patch ---
diff -up system-config-printer-1.1.18/asyncipp.py.asyncipp-traceback system-config-printer-1.1.18/asyncipp.py
--- system-config-printer-1.1.18/asyncipp.py.asyncipp-traceback	2010-03-26 12:54:45.031628084 +0000
+++ system-config-printer-1.1.18/asyncipp.py	2010-03-26 12:56:39.669630099 +0000
@@ -59,6 +59,7 @@ class _IPPConnectionThread(threading.Thr
         self._auth_handler = auth_handler
         self._auth_queue = Queue.Queue (1)
         self.user = None
+        self._destroyed = False
         debugprint ("+%s" % self)
 
     def __del__ (self):
@@ -157,6 +158,7 @@ class _IPPConnectionThread(threading.Thr
             self._queue.task_done ()
 
         debugprint ("Thread exiting")
+        self._destroyed = True
         del self._conn # already destroyed
         del self._reply_handler
         del self._error_handler
@@ -188,21 +190,23 @@ class _IPPConnectionThread(threading.Thr
         return password
 
     def _reply (self, result):
-        def send_reply (result):
-            self._reply_handler (self._conn, result)
+        def send_reply (handler, result):
+            if not self._destroyed:
+                handler (self._conn, result)
             return False
 
-        if self._reply_handler:
-            gobject.idle_add (send_reply, result)
+        if not self._destroyed and self._reply_handler:
+            gobject.idle_add (send_reply, self._reply_handler, result)
 
     def _error (self, exc):
-        def send_error (exc):
-            self._error_handler (self._conn, exc)
+        def send_error (handler, exc):
+            if not self._destroyed:
+                handler (self._conn, exc)
             return False
 
-        if self._error_handler:
+        if not self._destroyed and self._error_handler:
             debugprint ("Add %s to idle" % self._error_handler)
-            gobject.idle_add (send_error, exc)
+            gobject.idle_add (send_error, self._error_handler, exc)
 
 ###
 ### This is the user-visible class.  Although it does not inherit from
diff -up system-config-printer-1.1.18/asyncpk0.py.asyncipp-traceback system-config-printer-1.1.18/asyncpk0.py
--- system-config-printer-1.1.18/asyncpk0.py.asyncipp-traceback	2010-03-10 09:33:45.000000000 +0000
+++ system-config-printer-1.1.18/asyncpk0.py	2010-03-26 12:56:27.954754007 +0000
@@ -58,6 +58,9 @@ class _PK0AsyncMethodCall(asyncpk1._PK1A
         asyncpk1._PK1AsyncMethodCall._destroy (self)
 
     def _pk_error_handler (self, exc):
+        if self._destroyed:
+            return
+
         if exc.get_dbus_name () != asyncpk1.CUPS_PK_NEED_AUTH:
             return asyncpk1._PK1AsyncMethodCall._pk_error_handler (self, exc)
 
@@ -89,6 +92,9 @@ class _PK0AsyncMethodCall(asyncpk1._PK1A
             return asyncpk1._PK1AsyncMethodCall._pk_error_handler (self, exc)
 
     def _auth_reply_handler (self, result):
+        if self._destroyed:
+            return
+
         if type (result) != dbus.Boolean:
             self.call_fallback_fn ()
             return
@@ -103,6 +109,9 @@ class _PK0AsyncMethodCall(asyncpk1._PK1A
         self.call ()
 
     def _auth_error_handler (self, exc):
+        if self._destroyed:
+            return
+
         self.call_fallback_fn ()
 
 ###
diff -up system-config-printer-1.1.18/asyncpk1.py.asyncipp-traceback system-config-printer-1.1.18/asyncpk1.py
--- system-config-printer-1.1.18/asyncpk1.py.asyncipp-traceback	2010-03-26 12:54:45.071626463 +0000
+++ system-config-printer-1.1.18/asyncpk1.py	2010-03-26 12:56:27.958753092 +0000
@@ -64,6 +64,7 @@ class _PK1AsyncMethodCall:
         self._fallback_fn = fallback_fn
         self._fallback_args = args
         self._fallback_kwds = kwds
+        self._destroyed = False
         debugprint ("+_PK1AsyncMethodCall: %s" % self)
 
     def __del__ (self):
@@ -85,6 +86,7 @@ class _PK1AsyncMethodCall:
 
     def _destroy (self):
         debugprint ("DESTROY: %s" % self)
+        self._destroyed = True
         del self._bus
         del self._conn
         del self._pk_method_name
@@ -97,6 +99,9 @@ class _PK1AsyncMethodCall:
         del self._fallback_kwds
 
     def _pk_reply_handler (self, error, *args):
+        if self._destroyed:
+            return
+
         if str (error) == '':
             self._client_reply_handler (self._conn, self._unpack_fn (*args))
             self._destroy ()
@@ -106,6 +111,9 @@ class _PK1AsyncMethodCall:
         self.call_fallback_fn ()
 
     def _pk_error_handler (self, exc):
+        if self._destroyed:
+            return
+
         if exc.get_dbus_name () == CUPS_PK_NEED_AUTH:
             exc = cups.IPPError (cups.IPP_NOT_AUTHORIZED, 'pkcancel')
             self._client_error_handler (self._conn, exc)
@@ -123,10 +131,16 @@ class _PK1AsyncMethodCall:
         self._fallback_fn (*self._fallback_args, **self._fallback_kwds)
 
     def _ipp_reply_handler (self, conn, *args):
+        if self._destroyed:
+            return
+
         self._client_reply_handler (self._conn, *args)
         self._destroy ()
 
     def _ipp_error_handler (self, conn, *args):
+        if self._destroyed:
+            return
+
         self._client_error_handler (self._conn, *args)
         self._destroy ()
 


Index: system-config-printer.spec
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-printer/F-11/system-config-printer.spec,v
retrieving revision 1.354
retrieving revision 1.355
diff -u -p -r1.354 -r1.355
--- system-config-printer.spec	24 Mar 2010 10:41:01 -0000	1.354
+++ system-config-printer.spec	26 Mar 2010 14:16:16 -0000	1.355
@@ -7,7 +7,7 @@
 Summary: A printer administration tool
 Name: system-config-printer
 Version: 1.1.18
-Release: 5%{?dist}
+Release: 6%{?dist}
 License: GPLv2+
 URL: http://cyberelk.net/tim/software/system-config-printer/
 Group: System Environment/Base
@@ -19,6 +19,7 @@ Patch1: system-config-printer-missing-im
 Patch2: system-config-printer-reconnect-error.patch
 Patch3: system-config-printer-downloadable-drivers.patch
 Patch4: system-config-printer-JobCancel.patch
+Patch5: system-config-printer-asyncipp-traceback.patch
 
 BuildRequires: cups-devel >= 1.2
 BuildRequires: python-devel >= 2.4
@@ -79,6 +80,9 @@ the configuration tool.
 # Use upstream signature for JobCancel cups-pk-helper method (bug #576496).
 %patch4 -p1 -b .JobCancel
 
+# Fixed traceback in asyncipp (bug #576932).
+%patch5 -p1 -b .asyncipp-traceback
+
 %build
 %configure
 
@@ -185,6 +189,9 @@ rm -rf %buildroot
 exit 0
 
 %changelog
+* Fri Mar 26 2010 Tim Waugh <twaugh at redhat.com> - 1.1.18-6
+- Fixed traceback in asyncipp (bug #576932).
+
 * Wed Mar 24 2010 Tim Waugh <twaugh at redhat.com> - 1.1.18-5
 - Use upstream signature for JobCancel cups-pk-helper method (bug #576496).
 



More information about the scm-commits mailing list