If the errback is being called with an argument of Failure(Exception()) everywhere, shouldn't  the argument to addCallbacks also use this?  That would make the last part of the patch look like:

@@ -1568,7 +1568,7 @@
                                            (deferred, self), None,
-                                           None, None)
+                                           Failure(Exception()), None)
         else:
-            deferred.errback()
+            deferred.errback(Failure(Exception()))
         return deferred
        
     def connectionLost(self, reason=None):

I had been working on a patch based on Tim's patch to defer.py, that changed the arguments of errback to failure.DefaultException(None), that seems to work as well, and I didn't remove any files.  I'll attatch that patch, but I know almost nothing about twisted, and not a lot about python.

Bill

--- apt_proxy.py.orig	2006-07-05 00:57:16.000000000 -0500
+++ apt_proxy.py	2006-07-05 00:48:17.000000000 -0500
@@ -26,7 +26,8 @@
 import time
 import string
 import packages
-from twisted.python.failure import Failure
+from twisted.python import failure
+#from twisted.python.failure import Failure
 import memleak
 from twisted.internet import error
 #from posixfile import SEEK_SET, SEEK_CUR, SEEK_END
@@ -1557,7 +1558,7 @@
             elif last_access < min_time:
                 log.debug("file is too old: "+self.local_file, 'file_ok')
                 update_times[self.uri] = cur_time
-                deferred.errback()
+                deferred.errback(failure.DefaultException(None))
             else:
                 log.debug("file is ok: "+self.local_file, 'file_ok')
                 deferred.callback(None)
@@ -1568,9 +1569,9 @@
             verifier = FileVerifier(self)
             verifier.deferred.addCallbacks(file_ok, deferred.errback,
                                            (deferred, self), None,
-                                           None, None)
+                                           failure.DefaultException(None), None)
         else:
-            deferred.errback()
+            deferred.errback(failure.DefaultException(None))
         return deferred
         
     def connectionLost(self, reason=None):

Reply via email to