[Twisted-Python] Tracebacks being dropped from exceptions when using inlineCallbacks

glyph at divmod.com glyph at divmod.com
Tue Jan 13 20:34:52 EST 2009


On 13 Jan, 02:58 am, phil at bubblehouse.org wrote:
>On Jan 12, 2009, at 8:36 PM, Terry Jones wrote:
>>I think I've finally gotten to the bottom of why exceptions  sometimes 
>>lose
>>their tracebacks when using inlineCallbacks.
>[snip snip]
>>I'll stop for now. I have some suggestions for fixes, but I'm  already 
>>in
>>over my head.
>>
>>BTW, I get the impression that the Twisted core developers don't 
>>really use
>>inlineCallbacks. Is that correct?

>My impression is that there's a reluctance to advertise 
>inlineCallbacks too loudly, since using it still requires a thorough 
>understanding of Deferreds and asynchronous development to be used 
>effectively. New users really need to be starting with the 'old- 
>fashioned-way', and even experienced users must be careful that their 
>'mental model' of what the code is doing actually reflects reality...

This is partially true, but another big motivating factor here is that 
we *can't* use it, yet.  That'll be true until we want to drop python 
2.3 and 2.4 support, which seems like it's a ways off yet.

Even when that is available, it's really Twisted application / 
orchestration code that will benefit the most from inlineCallbacks; the 
lower-level infrastructure stuff in Twisted itself has more failure 
modes and more states that are inconvenient to account for using 
try/except blocks.

But hey, I'm glad you're finding it useful.  And we *should* fix the 
error-handling problems.  If it weren't useful, we wouldn't provide it 
:).  (And, IMHO, inlineCallbacks is a heck of a lot better than any of 
the earlier hackish mechanisms that tried to do the same thing, like 
deferredGenerator.)




More information about the Twisted-Python mailing list