Skip to content

Commit

Permalink
pythonGH-95815: Document less specific error for os.remove (pythonGH-…
Browse files Browse the repository at this point in the history
…99571)

os.remove can raise PermissionError instead of IsADirectoryError,
when the object to be removed is a directory (in particular on
macOS).

This reverts a change done in pythonGH-14262.
(cherry picked from commit 1cae31d)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
  • Loading branch information
ronaldoussoren authored and miss-islington committed Nov 21, 2022
1 parent ad47c7d commit ec50066
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2256,7 +2256,7 @@ features:
.. function:: remove(path, *, dir_fd=None)

Remove (delete) the file *path*. If *path* is a directory, an
:exc:`IsADirectoryError` is raised. Use :func:`rmdir` to remove directories.
:exc:`OSError` is raised. Use :func:`rmdir` to remove directories.
If the file does not exist, a :exc:`FileNotFoundError` is raised.

This function can support :ref:`paths relative to directory descriptors
Expand Down

0 comments on commit ec50066

Please sign in to comment.