Skip to content

Commit 2ea07c6

Browse files
committed
Revise doc for remove
1 parent 75ab0a3 commit 2ea07c6

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,24 @@ This package extends `zipfile` with `remove`-related functionalities.
1111

1212
* `ZipFile.remove(zinfo_or_arcname)`
1313

14-
Removes a member from the archive. *zinfo_or_arcname* may be the full path
15-
of the member or a `ZipInfo` instance.
16-
17-
If multiple members share the same full path, only one is removed when
18-
a path is provided.
19-
20-
This does not physically remove the local file entry from the archive.
21-
Call `repack` afterwards to reclaim space.
14+
Removes a member entry from the archive's central directory.
15+
*zinfo_or_arcname* may be the full path of the member or a `ZipInfo`
16+
instance. If multiple members share the same full path and the path is
17+
provided, only one of them is removed.
2218

2319
The archive must be opened with mode ``'w'``, ``'x'`` or ``'a'``.
2420

2521
Returns the removed `ZipInfo` instance.
2622

2723
Calling `remove` on a closed ZipFile will raise a `ValueError`.
2824

25+
> **Note:**
26+
> This method only removes the member's entry from the central directory,
27+
> making it inaccessible to most tools. The member's local file entry,
28+
> including content and metadata, remains in the archive and is still
29+
> recoverable using forensic tools. Call `repack` afterwards to completely
30+
> remove the member and reclaim space.
31+
2932
* `ZipFile.repack(removed=None, *, strict_descriptor=False[, chunk_size])`
3033

3134
Rewrites the archive to remove stale local file entries, shrinking its file

0 commit comments

Comments
 (0)