Skip to content

Commit 2573a3a

Browse files
maintain the original clarity that FileNotFound will be raised if missing_ok is false
1 parent 0db9ce0 commit 2573a3a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Doc/library/pathlib.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,6 +1625,8 @@ example because the path doesn't exist).
16251625
use :func:`Path.rmdir` instead.
16261626

16271627
This method propagates any :exc:`OSError` encountered during removal.
1628+
For example: If *missing_ok* is false (the default), :exc:`FileNotFoundError` is
1629+
raised if the path does not exist.
16281630

16291631
If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be
16301632
ignored (same behavior as the POSIX ``rm -f`` command).

0 commit comments

Comments
 (0)