Issue 8886: zipfile.ZipExtFile is a context manager, but that is not documented (original ) (raw )Created on 2010-06-03 11:39 by sandberg , last changed 2022-04-11 14:57 by admin . This issue is now closed .
Messages (6)
msg106941 - (view)
Author: Erik Carstensen (sandberg)
Date: 2010-06-03 11:39
It's nice that ZipFile is a context manager in 2.7. It would be nice and more consistent if the objects returned from ZipFile.open() were context managers too.
msg106945 - (view)
Author: Erik Carstensen (sandberg)
Date: 2010-06-03 12:10
Sorry, my mistake, ZipExtFile is indeed a context manager: I ran into the problem in 2.6, and checked whether it was fixed in 2.7; when quickly reading zipfile.py I saw that only ZipFile had context manager methods, I missed the BufferedIOBase inheritance. And when reading the tests I didn't see any 'with ZipFile.open(x) as y' expression. Maybe it still makes sense to document and test this. Changing the title.
msg106946 - (view)
Author: Erik Carstensen (sandberg)
Date: 2010-06-03 12:32
Patch that makes the zipfile test consistently use with statements to handle the return value of ZipFile.open().
msg121421 - (view)
Author: Brian Curtin (brian.curtin) *
Date: 2010-11-18 02:20
Fixed in r86506 for py3k. The maintenance branches recently had an RC in preparation for a release -- I'll backport once they go out.
msg134119 - (view)
Author: Roundup Robot (python-dev)
Date: 2011-04-20 02:16
New changeset 83a426e969f5 by Brian Curtin in branch '2.7': Fix #8886 . Use context managers throughout zipfile tests. http://hg.python.org/cpython/rev/83a426e969f5
msg265483 - (view)
Author: Roundup Robot (python-dev)
Date: 2016-05-13 18:20
New changeset ae50bf6e3ac8 by Serhiy Storchaka in branch '3.5': Restored test_interleaved. After issue #8886 it was a duplicate of https://hg.python.org/cpython/rev/ae50bf6e3ac8 New changeset 62d844d2bd07 by Serhiy Storchaka in branch 'default': Restored test_interleaved. After issue #8886 it was a duplicate of https://hg.python.org/cpython/rev/62d844d2bd07 New changeset ba823131b25e by Serhiy Storchaka in branch '2.7': Restored test_interleaved. After issue #8886 it was a duplicate of https://hg.python.org/cpython/rev/ba823131b25e
History
Date
User
Action
Args
2022-04-11 14:57:01
admin
set
github: 53132
2016-05-13 18:20:11
python-dev
set
messages: +
2011-04-20 02:16:58
brian.curtin
set
status: open -> closedstage: patch review -> resolvedresolution: accepted -> fixedversions: - Python 3.1
2011-04-20 02:16:02
python-dev
set
nosy: + python-dev messages: +
2010-11-18 02:20:59
brian.curtin
set
assignee: brian.curtin type: enhancement -> resource usageversions: + Python 3.1, Python 3.2, - Python 3.3nosy: + brian.curtin messages: + resolution: accepted
2010-11-03 22:42:01
ezio.melotti
set
nosy: + ezio.melotti stage: patch review
2010-06-03 12:32:58
sandberg
set
files: + with-ZipExtFile-in-test.patch keywords: + patch messages: +
2010-06-03 12:10:17
sandberg
set
messages: + title: zipfile.ZipExtFile should be a context manager -> zipfile.ZipExtFile is a context manager, but that is not documented
2010-06-03 11:39:26
sandberg
create