Skip to content

Commit e80568d

Browse files
Add a comment on when NotADirectoryErroris raised by Path.unlink()
1 parent ff1857d commit e80568d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Doc/library/pathlib.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,6 +1630,9 @@ example because the path doesn't exist).
16301630
If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be
16311631
ignored (same behavior as the POSIX ``rm -f`` command).
16321632

1633+
If an intermediate part of the path points to a file,
1634+
:exc:`NotADirectoryError` will be raised.
1635+
16331636
.. versionchanged:: 3.8
16341637
The *missing_ok* parameter was added.
16351638

0 commit comments

Comments
 (0)