diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-11-21 03:04:55 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-21 12:04:55 +0100 |
commit | bb4c09158324e0369e5cc1f6a021ebe144703202 (patch) | |
tree | ffdb3c1546075779fea9f10b38fed434bd694f88 | |
parent | [3.11] gh-99337: Fix compile errors with gcc 12 on macOS (GH-99470) (#99638) (diff) | |
download | cpython-bb4c09158324e0369e5cc1f6a021ebe144703202.tar.gz cpython-bb4c09158324e0369e5cc1f6a021ebe144703202.tar.bz2 cpython-bb4c09158324e0369e5cc1f6a021ebe144703202.zip |
[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 1cae31d26ba621f6b1f0656ad3d69a0236338bad)
Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
-rw-r--r-- | Doc/library/os.rst | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 74125aef057..6df697d4460 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -2326,7 +2326,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 |