This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author daniel.ugra
Recipients alexis, daniel.ugra, davide.rizzo, eric.araujo, ezio.melotti, jhylton, nadeem.vawda, orsenthil, pitrou, python-dev, vstinner
Date 2011-07-16.23:27:33
SpamBayes Score 0.0024242648
Marked as misclassified No
Message-id <1310858854.96.0.355665183993.issue12133@psf.upfronthosting.co.za>
In-reply-to
Content
This patch has introduced some problems for me with Python 3.2.1 (64-bit Arch Linux).

The following code:

with urllib.request.urlopen(url) as page:
    pass

raises "ValueError: I/O operation on closed file." exception when url is "http://www.imdb.com/".

When I removed "h.close()" (added by this patch) from request.py everything worked as expected.

Interestingly other URLs work flawlessly with patched code ("http://www.google.com/" for example).

I had no time to further investigate the differences between HTTP responses of "good" and "bad" sites... and I am by no means an HTTP expert :)

Should I open a new bug report for this one or is it OK to just leave this comment here?
History
Date User Action Args
2011-07-16 23:27:35daniel.ugrasetrecipients: + daniel.ugra, jhylton, orsenthil, pitrou, vstinner, nadeem.vawda, ezio.melotti, eric.araujo, alexis, davide.rizzo, python-dev
2011-07-16 23:27:34daniel.ugrasetmessageid: <1310858854.96.0.355665183993.issue12133@psf.upfronthosting.co.za>
2011-07-16 23:27:34daniel.ugralinkissue12133 messages
2011-07-16 23:27:33daniel.ugracreate