Skip to content

Commit 101dfae

Browse files
[3.10] GH-95815: Document less specific error for os.remove (GH-99571) (#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 <[email protected]>
1 parent ad47c7d commit 101dfae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Doc/library/os.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2256,7 +2256,7 @@ features:
22562256
.. function:: remove(path, *, dir_fd=None)
22572257

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

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

0 commit comments

Comments
 (0)