Skip to content

Commit 9892dfd

Browse files
committed
Document behavior changes
1 parent d462cc7 commit 9892dfd

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

Doc/library/zipfile.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,10 @@ ZipFile objects
227227
Similar behavior occurs with files newer than 2107-12-31,
228228
the timestamp is also set to the limit.
229229

230-
When mode is ``'r'``, *metadata_encoding* may be set to the name of a codec,
231-
which will be used to decode metadata such as the names of members and ZIP
232-
comments.
230+
The *metadata_encoding* argument may be set to the name of a codec, which
231+
will be used to decode metadata such as the names of members and ZIP
232+
comments when reading from an archive. This argument is ignored for writing
233+
new members.
233234

234235
If the file is created with mode ``'w'``, ``'x'`` or ``'a'`` and then
235236
:meth:`closed <close>` without adding any files to the archive, the appropriate
@@ -285,6 +286,10 @@ ZipFile objects
285286
Added support for specifying member name encoding for reading
286287
metadata in the zipfile's directory and file headers.
287288

289+
.. versionchanged:: next
290+
The *metadata_encoding* parameter is now allowed in all modes. Previously
291+
it could only be specified in mode ``'r'``.
292+
288293

289294
.. method:: ZipFile.close()
290295

0 commit comments

Comments
 (0)