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

2009-10-09 Thread Reza Lotun
Hi,


On Thu, Oct 8, 2009 at 10:31 PM, Steve Steiner (listsin)
 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).

> Can anyone tell me what it is about this particular transaction that's
> not allowing the deferred to fire its callbacks which I presume is
> because it never finishes getting the stuff it's looking for.  This
> particular URL returns a .vcf file.

Well, without seeing the complete code example that's failing I can't
really tell you. The best I can say is that you should make sure to
attach errBacks that log any errors you see (i.e. it could be as
simple as going 'print result.getTraceback()').

Cheers,
Reza

-- 
Reza Lotun
mobile: +44 (0)7521 310 763
email:  rlo...@gmail.com
work:   r...@tweetdeck.com
twitter: @rlotun

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


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

2009-10-09 Thread Reza Lotun
On Fri, Oct 9, 2009 at 10:53 AM, Reza Lotun  wrote:
> won't return returns. What you have to do is create your own slightly

I meant won't return headers ;-)

Reza

-- 
Reza Lotun
mobile: +44 (0)7521 310 763
email:  rlo...@gmail.com
work:   r...@tweetdeck.com
twitter: @rlotun

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Phasing out old-style classes

2009-10-09 Thread Tim Allen
On Fri, Oct 09, 2009 at 03:45:02AM -, exar...@twistedmatrix.com wrote:
> However, if I were to make up a plan for porting Twisted to Python 3.x, 
> then the first part of that plan would be to fix all of the failing 
> tests reported here:
> 
> http://buildbot.twistedmatrix.com/builders/python-3k- 
> warnings/builds/203/steps/trial/logs/problems
> 
> These are tests which fail when Twisted's test suite is run with the -3 
> option on Python 2.6.  Tickets for these failures and patches fixing 
> them would be greatly appreciated.

I found ticket 2484 which is (I believe) about making Twisted
translatable to Python 3.x with the stock 2to3 tool:

http://twistedmatrix.com/trac/ticket/2484

I've added a comment about all the DeprecationWarnings issued by
Twisted's test suite when run under Python 2.6's 3.x-compatibility
warning mode; there's an awful lot more than just the 24 that cause test
failures.

I've also filed a bug about fixing one of the warnings mentioned, the
one about has_key() being removed in 3.x:

http://twistedmatrix.com/trac/ticket/4053

There's a few other warnings for which cleanup patches would be a good
lazy-afternoon effort. :)

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


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

2009-10-09 Thread listsin

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.

Thanks for your help.

S


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


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

2009-10-09 Thread Steve Steiner (listsin)

On Oct 10, 2009, at 1:34 AM, Steve Steiner (listsin) wrote:
> Along the way, I ran into:
>
>   http://python.net/crew/mwh/apidocs/twisted.web.http.Request.html

Just realized that that was off-twistedmatrix, same doc at:


http://twistedmatrix.com/documents/8.2.0/api/twisted.web.http.Request.html

so it's not some off-site weirdness...

S


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python