[New-bugs-announce] [issue22755] contextlib.closing documentation should use a new example

Martijn Pieters report at bugs.python.org
Tue Oct 28 23:40:52 CET 2014

New submission from Martijn Pieters:

urllib.request.urlopen() now always produces a context manager (either a HTTPResponse or addinfourl object). The example for contextlib.closing still uses urllib.request.urlopen as an example for the context manager wrapper, see


This is confusing users that now expect the object not to be a context manager, see:


Can a different example be chosen?

assignee: docs at python
components: Documentation
messages: 230184
nosy: docs at python, mjpieters
priority: normal
severity: normal
status: open
title: contextlib.closing documentation should use a new example
versions: Python 3.4, Python 3.5, Python 3.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list