@@ -360,13 +360,6 @@ ZipFile Objects
360360 the new entry.
361361 The archive must be open with mode ``'w' ``, ``'x' `` or ``'a' ``.
362362
363- .. note ::
364-
365- There is no official file name encoding for ZIP files. If you have unicode file
366- names, you must convert them to byte strings in your desired encoding before
367- passing them to :meth: `write `. WinZip interprets all file names as encoded in
368- CP437, also known as DOS Latin.
369-
370363 .. note ::
371364
372365 Archive names should be relative to the archive root, that is, they should not
@@ -385,7 +378,9 @@ ZipFile Objects
385378
386379.. method :: ZipFile.writestr(zinfo_or_arcname, data[, compress_type])
387380
388- Write the string *data * to the archive; *zinfo_or_arcname * is either the file
381+ Write a file into the archive. The contents is *data *, which may be either
382+ a :class: `str ` or a :class: `bytes ` instance; if it is a :class: `str `,
383+ it is encoded as UTF-8 first. *zinfo_or_arcname * is either the file
389384 name it will be given in the archive, or a :class: `ZipInfo ` instance. If it's
390385 an instance, at least the filename, date, and time must be given. If it's a
391386 name, the date and time is set to the current date and time.
@@ -425,11 +420,11 @@ The following data attributes are also available:
425420
426421.. attribute :: ZipFile.comment
427422
428- The comment text associated with the ZIP file. If assigning a comment to a
423+ The comment associated with the ZIP file as a :class: `bytes ` object.
424+ If assigning a comment to a
429425 :class: `ZipFile ` instance created with mode ``'w' ``, ``'x' `` or ``'a' ``,
430- this should be a
431- string no longer than 65535 bytes. Comments longer than this will be
432- truncated in the written archive when :meth: `close ` is called.
426+ it should be no longer than 65535 bytes. Comments longer than this will be
427+ truncated.
433428
434429
435430.. _pyzipfile-objects :
@@ -583,13 +578,14 @@ Instances have the following methods and attributes:
583578
584579.. attribute :: ZipInfo.comment
585580
586- Comment for the individual archive member.
581+ Comment for the individual archive member as a :class: ` bytes ` object .
587582
588583
589584.. attribute :: ZipInfo.extra
590585
591586 Expansion field data. The `PKZIP Application Note `_ contains
592- some comments on the internal structure of the data contained in this string.
587+ some comments on the internal structure of the data contained in this
588+ :class: `bytes ` object.
593589
594590
595591.. attribute :: ZipInfo.create_system
0 commit comments