Skip to content

Commit

Permalink
[3.10] GH-95815: Document less specific error for os.remove (GH-99571) (
Browse files Browse the repository at this point in the history
#99639)

GH-95815: Document less specific error for os.remove (GH-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 GH-14262.
(cherry picked from commit 1cae31d)


Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
  • Loading branch information
miss-islington and ronaldoussoren committed Nov 21, 2022
1 parent ad47c7d commit 101dfae
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 101dfae

Please sign in to comment.