Skip to content

Commit

Permalink
clarify that FileNotFoundError is a subclass of OSError
Browse files Browse the repository at this point in the history
  • Loading branch information
MusicalNinjaDad committed Jun 30, 2024
1 parent 2573a3a commit f3269d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1624,12 +1624,12 @@ example because the path doesn't exist).
Remove this file or symbolic link. If the path points to a directory,
use :func:`Path.rmdir` instead.

This method propagates any :exc:`OSError` encountered during removal.
For example: If *missing_ok* is false (the default), :exc:`FileNotFoundError` is
raised if the path does not exist.
If *missing_ok* is false (the default), this method propagates any
:exc:`OSError` from the operating system, including :exc:`FileNotFoundError`.

If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be
ignored (same behavior as the POSIX ``rm -f`` command).
ignored (same behavior as the POSIX ``rm -f`` command), any other
:exc:`OSError` which is encountered will continue to be propogated.

.. versionchanged:: 3.8
The *missing_ok* parameter was added.
Expand Down

0 comments on commit f3269d9

Please sign in to comment.