@@ -584,7 +584,7 @@ ZipFile objects
584584 If *removed * is provided, it must be a sequence of :class: `ZipInfo ` objects
585585 representing the recently removed members, and only their corresponding
586586 local file entries will be removed. This is the most efficient and reliable
587- way to reclaim space. For example::
587+ way to reclaim space. A brief example looks like ::
588588
589589 with ZipFile('spam.zip', 'a') as myzip:
590590 removed = [myzip.remove(name) for name in ('ham.txt', 'eggs.txt')]
@@ -593,22 +593,21 @@ ZipFile objects
593593 If *removed * is omitted, the archive is scanned to locate and remove local
594594 file entries that are no longer referenced in the central directory.
595595
596- When scanning, *strict_descriptor * controls how entries written with an
597- unsigned * data descriptor * are handled. A data descriptor is an optional
598- record stored after an entry's data, which can be either signed (beginning
599- with a magic signature) or unsigned, and is mandatory for an archive written
600- to a non-seekable stream . Unsigned descriptors have been deprecated by the
596+ When scanning, *strict_descriptor * controls how entries with an unsigned
597+ data descriptor are handled. A data descriptor is an optional record (but
598+ mandatory for an archive written to a non-seekable stream) stored after an
599+ entry's data, and can be either signed (beginning with a magic signature) or
600+ unsigned . Unsigned descriptors have been deprecated by the
601601 `PKZIP Application Note `_ since version 6.3.0 (released in 2006) and are
602602 rarely produced by modern tools.
603603
604604 When *strict_descriptor * is true (the default), unsigned descriptors are
605605 not detectable, and unreferenced entries using them are not recognized and
606606 their space is not reclaimed. Setting ``strict_descriptor=False `` allows
607- such unsigned descriptors and related entries to be recognized, at the cost
608- of a significantly slower scan—around 100 to 1000 times in the worst
609- case—which may be exploitable as a denial-of-service vector on untrusted
610- input. Entries without a descriptor or with a signed descriptor are
611- unaffected.
607+ such entries to be properly handled, at the cost of a significantly slower
608+ scan—around 100 to 1000 times in the worst case—which may be exploitable
609+ as a denial-of-service vector on untrusted input. Entries without a
610+ descriptor or with a signed descriptor are unaffected.
612611
613612 *chunk_size * may be specified to control the buffer size when moving
614613 entry data (default is 1 MiB).
0 commit comments