Author Valery.Khamenya
Recipients Valery.Khamenya, docs@python
Date 2011-09-10.10:30:27
SpamBayes Score 0.123681
Marked as misclassified No
Message-id <1315650628.73.0.673162910121.issue12955@psf.upfronthosting.co.za>
In-reply-to
Content
The following intuitive construction

with urllib2.build_opener().open() as:
    ...

leads to AttributeError: addinfourl instance has no attribute '__exit__'

http://docs.python.org/library/urllib2.html says almost nothing about concept of closing.

Could it be possible to add a canonical "with ... as:" example for urllib2.build_opener() ?

Thanks,
Valery
History
Date User Action Args
2011-09-10 10:30:28Valery.Khamenyasetrecipients: + Valery.Khamenya, docs@python
2011-09-10 10:30:28Valery.Khamenyasetmessageid: <1315650628.73.0.673162910121.issue12955@psf.upfronthosting.co.za>
2011-09-10 10:30:28Valery.Khamenyalinkissue12955 messages
2011-09-10 10:30:27Valery.Khamenyacreate