Skip to content

Commit bb4c091

Browse files
[3.11] GH-95815: Document less specific error for os.remove (GH-99571) (#99641)
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]> Co-authored-by: Ronald Oussoren <[email protected]>
1 parent aa06786 commit bb4c091

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
@@ -2326,7 +2326,7 @@ features:
23262326
.. function:: remove(path, *, dir_fd=None)
23272327

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

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

0 commit comments

Comments
 (0)