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 jdufresne
Recipients SilentGhost, jdufresne, r.david.murray
Date 2016-12-07.16:25:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1481127945.72.0.59434970401.issue28867@psf.upfronthosting.co.za>
In-reply-to
Content
Just for some context, the e.close() is handling this bit of code:

https://github.com/python/cpython/blob/d8132c4da7c46587221c5a244224b770d03860b6/Lib/urllib/request.py#L739-L754

When there is no error, http_error_302() will close the passed fp, on error, it will not. The following comment indicates this is intentional:

# Don't close the fp until we are sure that we won't use it
# with HTTPError.

But I agree, this may pose a problem when enforcing deterministic resource handling.
History
Date User Action Args
2016-12-07 16:25:45jdufresnesetrecipients: + jdufresne, r.david.murray, SilentGhost
2016-12-07 16:25:45jdufresnesetmessageid: <1481127945.72.0.59434970401.issue28867@psf.upfronthosting.co.za>
2016-12-07 16:25:45jdufresnelinkissue28867 messages
2016-12-07 16:25:45jdufresnecreate