From: Raymond Hettinger Date: Thu, 27 Jan 2011 07:34:45 +0000 (+0000) Subject: More typical sample invocation of tarfile. X-Git-Tag: v3.2rc2~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e6f0abf34ae80a5b25543f18c4a73dfae85f1b4d;p=python More typical sample invocation of tarfile. --- diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst index 8901b5ccbb..94257ae350 100644 --- a/Doc/whatsnew/3.2.rst +++ b/Doc/whatsnew/3.2.rst @@ -1344,7 +1344,7 @@ function can return *None*:: tarinfo.uname = 'monty' # redact the user name return tarinfo - >>> with tarfile.TarFile(name='myarchive.tar', mode='w') as tf: + >>> with tarfile.open(name='myarchive.tar.gz', mode='w:gz') as tf: for filename in glob.glob('*.txt'): tf.add(filename, filter=myfilter) tf.list()