[issue12487] urllib2.urlopen() returns object missing context manager

Peter Schuller report at bugs.python.org
Mon Jul 4 12:18:25 CEST 2011


New submission from Peter Schuller <peter.schuller at infidyne.com>:

The documentation states it returns a "file-like object". In Python 2.5+ I expect such file-like objects to have a context manager for use with the with statement.

In my particular use-case, the lack comes from urllib.addinfourl but I have not investigated what the possible types returned may be.

----------
components: Library (Lib)
messages: 139746
nosy: scode
priority: normal
severity: normal
status: open
title: urllib2.urlopen() returns object missing context manager
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12487>
_______________________________________


More information about the Python-bugs-list mailing list