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 daniel.ugra
Date 2011-07-17.00:07:43
SpamBayes Score 4.5566227e-05
Marked as misclassified No
Message-id <1310861264.06.0.891924584954.issue12576@psf.upfronthosting.co.za>
In-reply-to
Content
Issue #12133 introduced a patch which seems to cause problems.
I'm using Python 3.2.1 on 64-bit Arch Linux (this version already incorporates the changes from #12133).

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 the patch) from request.py everything worked as expected.
Other URLs work flawlessly with patched code ("http://www.google.com/" for example).

Maybe it is something to do with differences in HTTP responses or in server-side behavior.
For example IMDb's "Cneonction: close" (not a typo) feature.
But this could be totally unrelated, I am by no means an HTTP expert.
History
Date User Action Args
2011-07-17 00:07:44daniel.ugrasetrecipients: + daniel.ugra
2011-07-17 00:07:44daniel.ugrasetmessageid: <1310861264.06.0.891924584954.issue12576@psf.upfronthosting.co.za>
2011-07-17 00:07:43daniel.ugralinkissue12576 messages
2011-07-17 00:07:43daniel.ugracreate