GH-95815: Document less specific error for os.remove (#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 #14262.
This commit is contained in:
Ronald Oussoren 2022-11-21 11:08:06 +01:00 committed by GitHub
parent cdde29dde9
commit 1cae31d26b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2421,7 +2421,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