Skip to content

Commit cb41db4

Browse files
damijunmiss-islington
authored andcommitted
gh-121509: Clarify that os.remove may raise PermissionError on Windows (GH-162875)
(cherry picked from commit 9d6fa5d) Co-authored-by: WenXuan Xu <73049206+damijun@users.noreply.github.com>
1 parent 8fa0152 commit cb41db4

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎Doc/library/os.rst‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2793,9 +2793,10 @@ features:
27932793
This function can support :ref:`paths relative to directory descriptors
27942794
<dir_fd>`.
27952795

2796-
On Windows, attempting to remove a file that is in use causes an exception to
2797-
be raised; on Unix, the directory entry is removed but the storage allocated
2798-
to the file is not made available until the original file is no longer in use.
2796+
On Windows, attempting to remove a file that is in use may raise
2797+
:exc:`PermissionError`; on Unix, the directory entry is removed but the
2798+
storage allocated to the file is not made available until the original file
2799+
is no longer in use.
27992800

28002801
This function is semantically identical to :func:`unlink`.
28012802

0 commit comments

Comments
 (0)