diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2010-02-07 20:24:02 (GMT) |
---|---|---|
committer | Ronald Oussoren <ronaldoussoren@mac.com> | 2010-02-07 20:24:02 (GMT) |
commit | ee5c885fd2446dea7269c65248312a0856f50fd3 (patch) | |
tree | 2d2fdd42b64d0febbe419f35087e866c0ca0f5c9 /Doc/library/zipfile.rst | |
parent | 755740f3ea9c5005d16a80c07e7fc26e45f11aa1 (diff) | |
download | cpython-ee5c885fd2446dea7269c65248312a0856f50fd3.zip cpython-ee5c885fd2446dea7269c65248312a0856f50fd3.tar.gz cpython-ee5c885fd2446dea7269c65248312a0856f50fd3.tar.bz2 |
Merged revisions 78097 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78097 | ronald.oussoren | 2010-02-07 21:18:02 +0100 (Sun, 07 Feb 2010) | 2 lines
Issue 6003: ZipFile.writestr "compression_type" argument
........
Diffstat (limited to 'Doc/library/zipfile.rst')
-rw-r--r-- | Doc/library/zipfile.rst | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index 78f9299..7648e36 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -267,7 +267,7 @@ ZipFile Objects byte, the name of the file in the archive will be truncated at the null byte. -.. method:: ZipFile.writestr(zinfo_or_arcname, bytes) +.. method:: ZipFile.writestr(zinfo_or_arcname, bytes[, compress_type]) Write the string *bytes* to the archive; *zinfo_or_arcname* is either the file name it will be given in the archive, or a :class:`ZipInfo` instance. If it's @@ -277,6 +277,10 @@ ZipFile Objects created with mode ``'r'`` will raise a :exc:`RuntimeError`. Calling :meth:`writestr` on a closed ZipFile will raise a :exc:`RuntimeError`. + If given, *compress_type* overrides the value given for the *compression* + parameter to the constructor for the new entry, or in the *zinfo_or_arcname* + (if that is a :class:`ZipInfo` instance). + .. note:: When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter, @@ -284,6 +288,9 @@ ZipFile Objects member of the given :class:`ZipInfo` instance. By default, the :class:`ZipInfo` constructor sets this member to :const:`ZIP_STORED`. + .. versionchanged:: 2.7 + The *compression_type* argument. + The following data attributes are also available: |