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 martin.panter
Recipients Valery.Khamenya, docs@python, eric.araujo, ezio.melotti, javawizard, martin.panter, ncoghlan, orsenthil, terry.reedy
Date 2015-02-09.01:22:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1423444937.6.0.576881580862.issue12955@psf.upfronthosting.co.za>
In-reply-to
Content
Here is a patch to change the urlopen() examples to use context managers where appropriate.

There were also a few examples of handling HTTPError which I didn’t touch, because the whole file object versus exception object thing is probably a separate can of worms.
History
Date User Action Args
2015-02-09 01:22:17martin.pantersetrecipients: + martin.panter, terry.reedy, ncoghlan, orsenthil, ezio.melotti, eric.araujo, docs@python, Valery.Khamenya, javawizard
2015-02-09 01:22:17martin.pantersetmessageid: <1423444937.6.0.576881580862.issue12955@psf.upfronthosting.co.za>
2015-02-09 01:22:17martin.panterlinkissue12955 messages
2015-02-09 01:22:16martin.pantercreate