Skip to content

Commit 0db9ce0

Browse files
don't prefer any specific OSError type in Path.unlink documentation
1 parent e80568d commit 0db9ce0

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Doc/library/pathlib.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,15 +1624,11 @@ example because the path doesn't exist).
16241624
Remove this file or symbolic link. If the path points to a directory,
16251625
use :func:`Path.rmdir` instead.
16261626

1627-
If *missing_ok* is false (the default), :exc:`FileNotFoundError` is
1628-
raised if the path does not exist.
1627+
This method propagates any :exc:`OSError` encountered during removal.
16291628

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

1633-
If an intermediate part of the path points to a file,
1634-
:exc:`NotADirectoryError` will be raised.
1635-
16361632
.. versionchanged:: 3.8
16371633
The *missing_ok* parameter was added.
16381634

0 commit comments

Comments
 (0)