Skip to content

Commit 9b4d22b

Browse files
make the documentation more succinct
implements comments from @barneygale
1 parent a4cb846 commit 9b4d22b

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Doc/library/pathlib.rst

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,20 +1631,18 @@ Copying, renaming and deleting
16311631
use :func:`Path.rmdir` instead.
16321632

16331633
If *missing_ok* is false (the default), this method propagates any
1634-
:exc:`OSError` from the operating system, including :exc:`FileNotFoundError`.
1634+
:exc:`OSError` from the operating system.
16351635

1636-
If *missing_ok* is true, this shows similar behavior to the POSIX ``rm -f``
1637-
command and any :exc:`FileNotFoundError` or :exc:`NotADirectoryError`
1638-
exceptions will be ignored. This means that the file does not exist after
1639-
execution, but cannot guarantee that the file did exist before. Any other
1640-
:exc:`OSError` which is encountered will continue to be propogated.
1636+
If *missing_ok* is true, :exc:`FileNotFoundError` and
1637+
:exc:`NotADirectoryError` exceptions will be ignored. This behavior is
1638+
similar to the POSIX ``rm -f`` command.
16411639

16421640
.. versionchanged:: 3.8
16431641
The *missing_ok* parameter was added.
16441642

1645-
.. versionchanged:: 3.??
1646-
The *missing_ok* parameter will also ignore :exc:`NotADirectoryError`
1647-
1643+
.. versionchanged:: 3.14
1644+
Suppresses :exc:`NotADirectoryError` exceptions when *missing_ok* is
1645+
true.
16481646

16491647
.. method:: Path.rmdir()
16501648

0 commit comments

Comments
 (0)