Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2732,7 +2732,10 @@ features:
.. function:: remove(path, *, dir_fd=None)

Remove (delete) the file *path*. If *path* is a directory, an
:exc:`OSError` is raised. Use :func:`rmdir` to remove directories.
:exc:`OSError` is raised. The exact subclass depends on the platform:
for example, :exc:`IsADirectoryError` on Linux or :exc:`PermissionError`
on macOS.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows raises a PermissionError as well.

Suggested change
on macOS.
on macOS and Windows.

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
Expand Down
Loading