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

Steve Steiner (listsin) listsin at integrateddevcorp.com
Sat Oct 10 01:34:03 EDT 2009

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:


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  

Thanks for your help.


More information about the Twisted-Python mailing list