Terry J. Reedy tjre...@udel.edu added the comment:
As I understand this, you are asking that 2.7 urllib2.build_opener().open(),
which in 3.x is urllib.request.build_opener().open(), be upgraded to return an
object that works as a context manager. Unless the docs say that this should
already
Senthil Kumaran sent...@uthcode.com added the comment:
Just as a quick guideline. If you are talking about context manager
support for urlopen, it is available and present in 3.x but not on
2.7. And I fear, it is late to make it available on 2.7, because it is
a feature.
In any case, as Terry
Valery Khamenya khame...@gmail.com added the comment:
Terry, Senthil, thanks, for replying to this ticket. OK, to the question:
1. @Terry, here is the full example as for CPython 2.7 I am talking about and
the output:
#
from urllib2 import Request, build_opener
request =
New submission from Valery Khamenya khame...@gmail.com:
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
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti, orsenthil
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12955
___
___