[issue22154] ZipFile.open context manager support

2015-03-12 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the patch, Mike. -- nosy: +berker.peksag resolution: -> fixed stage: needs patch -> resolved status: open -> closed type: behavior -> enhancement versions: +Python 3.4 ___ Python tracker

[issue22154] ZipFile.open context manager support

2015-03-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset b6fdf8c7a74d by Berker Peksag in branch '3.4': Issue #22154: Add an example to show context management protocol support of ZipFile.open(). https://hg.python.org/cpython/rev/b6fdf8c7a74d New changeset 390a2f4dfd4a by Berker Peksag in branch 'default

[issue22154] ZipFile.open context manager support

2015-03-07 Thread Tuomas Suutari
Tuomas Suutari added the comment: The context manager support was added on issue #5511, so the documentation should go to 2.7, 3.4 and default. Also the version added notes should be added. -- nosy: +Tuomas Suutari ___ Python tracker

[issue22154] ZipFile.open context manager support

2014-09-01 Thread Mike Short
Mike Short added the comment: Context manager comment & code snippet added to zipfile doc - patch attached. -- keywords: +patch nosy: +Mike.Short Added file: http://bugs.python.org/file36521/zipfile.patch ___ Python tracker

[issue22154] ZipFile.open context manager support

2014-08-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be. -- assignee: -> docs@python components: +Documentation -Library (Lib) keywords: +easy nosy: +docs@python priority: normal -> low resolution: out of date -> stage: resolved -> needs patch status: closed -> open type: enhancement -> behavior _

[issue22154] ZipFile.open context manager support

2014-08-06 Thread Ralph Broenink
Ralph Broenink added the comment: Perhaps this should be documented then :) -- ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue22154] ZipFile.open context manager support

2014-08-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is already implemented. >>> with ZipFile("Lib/test/zip_cp437_header.zip", "r") as z: ... with z.open("filename_without.txt", "r") as f: ... print(f.read()) ... print(f.closed) ... b'EOF\r\n' True -- components: +Library (Lib) -Ex

[issue22154] ZipFile.open context manager support

2014-08-06 Thread Ralph Broenink
New submission from Ralph Broenink: In Python 3.2, context manager support for ZipFile was added. However, I would also love the ability for ``ZipFile.open`` to be used as a context manager, e.g.: from zipfile import ZipFile with ZipFile("test.zip", "r") as z: with z.open("test