[Twisted-Python] HTTPClientFactory's deferred never finishing download on .vcf (vcard file) link

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Sat Oct 10 07:43:39 MDT 2009


On 05:34 am, listsin at integrateddevcorp.com wrote:
>
>On Oct 9, 2009, at 5:53 AM, Reza Lotun wrote:
>>>I haven't found any way to dump the actual headers from within
>>>Twisted
>>
>>The getPage function in twisted.web is suited for simple calls but
>>won't return returns. What you have to do is create your own slightly
>>modified version of getPage that keeps track of the factory used for
>>the call (by attaching it to the deferred or something).
>
>Yah, I kind of think this code was intended to do his own getPage()
>but I'm not exactly sure what the point was.  Maybe he used it for
>debugging along the way, but the original intent was lost due to lack
>of VCS (as was he!)
>
>I ended up rewriting it to use the simple client.getPage()
>
>Along the way, I ran into:
>
>http://python.net/crew/mwh/apidocs/twisted.web.http.Request.html
>
>Good Lord, no wonder I'm confused.
>
>Half PEP-8, http://www.python.org/dev/peps/pep-0008/, half JavaRama.
>
>I finally figured out that it was a stupid string formatting bug in
>the code that was being echoed by Twisted but swallowed by the "Grand
>Catcher of all Things Exception" in Twisted..
>
>Once I found and fixed that, everything works fine -- until the next
>time.

As Reza Lotun pointed out, exceptions raised by application code and 
caught by Twisted are logged.  If you find a place where application 
code can raise an exception and Twisted doesn't log it, this is a bug 
and should be reported.

Jean-Paul




More information about the Twisted-Python mailing list