[IronPython] urllib.urlretrieve with IronPython 2a8

Curt Hagenlocher curt at hagenlocher.org
Mon Feb 18 15:34:59 PST 2008


On Feb 18, 2008 3:11 PM, Michael Foord <fuzzyman at voidspace.org.uk> wrote:
>
> On 18/02/2008, Curt Hagenlocher <curt at hagenlocher.org> wrote:
>> I should amend this to say that I can *inconsistently* reproduce it.  The URL
>> in the original sample always fails with that error, but
http://www.microsoft.com
>> has been succeeding for me more often than not.
>
> Hmmm... could be a difference in the default socket timeout, or when the socket
> object is created (?). Whatever the cause I think the bug should be reopened.

One difference between the two is that www.microsoft.com actually has
an HTTP redirect involved, while the failing version does not.

Here's a simpler way to reproduce the problem:

import httplib
h = httplib.HTTP('www.google.com')
h.putrequest('GET', '/')
h.endheaders()
a, b, c = h.getreply()
fp = h.getfile()
fp.read(1024*8)

This fails with the same "disposed object" error, but replacing google
with microsoft makes it work correctly.  Any "business/political"
implications thereof are left as an exercise to the reader ;).

--
Curt Hagenlocher
curt at hagenlocher.org


More information about the Users mailing list