Re: [Twisted-Python] Twisted Plugins - Implementation Discussion

2011-04-20 Thread Kevin Horn
> I don't believe 'distribute' is ever making it into the standard library. > The thing going into python 3.3 is 'packaging', which, obviously, is a copy > (hopefully unmodified) of 'distutils2', which has nothing in common with > 'distribute' except for its author. > > 'distribute' is a fork of s

Re: [Twisted-Python] Understanding deferred and error handling

2011-04-20 Thread exarkun
On 01:04 am, courn...@gmail.com wrote: >but not what I consider the meat of my issue, that is >the lack of traceback. Fixing and simplifying my initial example: > >import twisted.web.client > >from twisted.internet import defer >from twisted.internet import reactor > >def remote_call(): >d = tw

Re: [Twisted-Python] Understanding deferred and error handling

2011-04-20 Thread David Cournapeau
On Thu, Apr 21, 2011 at 2:31 AM, Phil Mayers wrote: > On 04/20/2011 05:28 AM, David wrote: >> Hi, >> >> I have a hard time figuring out error handling with deferred in twisted. >> More exactly, I don't understand how to always get meaningful tracebacks >> to understand where the error actually hap

Re: [Twisted-Python] Understanding deferred and error handling

2011-04-20 Thread Phil Mayers
On 04/20/2011 05:28 AM, David wrote: > Hi, > > I have a hard time figuring out error handling with deferred in twisted. > More exactly, I don't understand how to always get meaningful tracebacks > to understand where the error actually happened. For a simple example: > > import sys > > import twist

Re: [Twisted-Python] Understanding deferred and error handling

2011-04-20 Thread Tristan Seligmann
On Wed, Apr 20, 2011 at 12:15 PM, Jason Rennie wrote: >> >>     def log_error(failure): >> >>         log.err(failure.printTraceback()) >>         return failure >>     d.addErrback(log_error) >>     d.addBoth(_stop) > > Use d.addCallbacks(_stop, log_error) instead of addBoth/addErrback.  Also, >

Re: [Twisted-Python] Understanding deferred and error handling

2011-04-20 Thread Jason Rennie
On Wed, Apr 20, 2011 at 12:28 AM, David wrote: > def _stop(arg): > reactor.stop() > d.addBoth(_stop) > Try using addCallbacks instead of addBoth. Then, you can logically separate code to handle/print errors from "normal" code. This will simply print no error in the log: > That