[Python-checkins] r88213 - python/branches/py3k/Doc/whatsnew/3.2.rst

raymond.hettinger python-checkins at python.org
Thu Jan 27 08:34:46 CET 2011


Author: raymond.hettinger
Date: Thu Jan 27 08:34:45 2011
New Revision: 88213

Log:
More typical sample invocation of tarfile.


Modified:
   python/branches/py3k/Doc/whatsnew/3.2.rst

Modified: python/branches/py3k/Doc/whatsnew/3.2.rst
==============================================================================
--- python/branches/py3k/Doc/whatsnew/3.2.rst	(original)
+++ python/branches/py3k/Doc/whatsnew/3.2.rst	Thu Jan 27 08:34:45 2011
@@ -1344,7 +1344,7 @@
                 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()


More information about the Python-checkins mailing list