mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
[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 1cae31d26b)
Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
This commit is contained in:
parent
ad47c7d926
commit
101dfaedb2
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue