Re: Problem with slow httplib connections on Windows (and maybe other platforms)

2009-02-01 Thread Christoph Zwerschke
Steve Holden schrieb: Search for the subject line "socket.create_connection slow" - this was discovered by Kristjan Valur Jonsson. It certainly seems like a Microsoft weirdness. Thanks for the pointer, Steve. I hadn't seen that yet. I agree that's actually the real problem here. The solution s

Re: Problem with slow httplib connections on Windows (and maybe other platforms)

2009-02-01 Thread Steve Holden
rdmur...@bitdance.com wrote: > Quoth Christoph Zwerschke : >> rdmur...@bitdance.com schrieb: >>> Quoth Christoph Zwerschke : With Py 2.3 (without IPv6 support) this is only the IPv4 address, but with Py 2.4-2.6 the order is (on my Win XP host) the IPv6 address first, then th

Re: Problem with slow httplib connections on Windows (and maybe other platforms)

2009-02-01 Thread rdmurray
Quoth Christoph Zwerschke : > rdmur...@bitdance.com schrieb: > > Quoth Christoph Zwerschke : > >>With Py 2.3 (without IPv6 support) this is only the IPv4 address, > >>but with Py 2.4-2.6 the order is (on my Win XP host) the IPv6 address > >>first, then the IPv4 address. Since the IPv6 a

Re: Problem with slow httplib connections on Windows (and maybe other platforms)

2009-02-01 Thread Christoph Zwerschke
rdmur...@bitdance.com schrieb: Quoth Christoph Zwerschke : With Py 2.3 (without IPv6 support) this is only the IPv4 address, but with Py 2.4-2.6 the order is (on my Win XP host) the IPv6 address first, then the IPv4 address. Since the IPv6 address is checked first, this gives a timeo

Problem with slow httplib connections on Windows (and maybe other platforms)

2009-02-01 Thread rdmurray
Quoth Christoph Zwerschke : > What actually happens is the following: > > * BaseHTTPServer binds only to the IPv4 address of localhost, because >it's based on TCPServer which has address_family=AF_INET by default. > > * HTTPConnection.connect() however tries to connect to all IP addresses >

Problem with slow httplib connections on Windows (and maybe other platforms)

2009-02-01 Thread Christoph Zwerschke
It cost me a while to analyze the cause of the following problem. The symptom was that testing a local web app with twill was fast on Python 2.3, but very slow on Python 2.4-2.6 on a Win XP box. This boiled down to the problem that if you run a SimpleHTTPServer for localhost like this, BaseHT