[New-bugs-announce] [issue9928] weird oddity with bz2 context manager

Antoine Pitrou report at bugs.python.org
Thu Sep 23 19:44:20 CEST 2010

New submission from Antoine Pitrou <pitrou at free.fr>:

I haven't investigated but this is weird (especially the fact that it doesn't *always* happen). There might be a problem with SETUP_WITH or perhaps the method cache:

>>> import bz2
>>> f = bz2.BZ2File('foo.bz2', 'wb')
>>> with f: pass
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: __exit__
>>> f.__enter__().__exit__(None, None, None)

components: Interpreter Core, Library (Lib)
messages: 117210
nosy: amaury.forgeotdarc, arigo, benjamin.peterson, pitrou
priority: normal
severity: normal
status: open
title: weird oddity with bz2 context manager
type: behavior
versions: Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list