Skip to content

Commit 5ab9692

Browse files
committed
gh-61745: Clarify os.listdir behavior for empty path
1 parent 72eca2a commit 5ab9692

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Doc/library/os.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,6 +2380,8 @@ features:
23802380
entries ``'.'`` and ``'..'`` even if they are present in the directory.
23812381
If a file is removed from or added to the directory during the call of
23822382
this function, whether a name for that file be included is unspecified.
2383+
*path* must refer to an existing directory. Passing ``''`` raises
2384+
:exc:`FileNotFoundError`; use ``'.'`` to list the current directory.
23832385

23842386
*path* may be a :term:`path-like object`. If *path* is of type ``bytes``
23852387
(directly or indirectly through the :class:`PathLike` interface),

0 commit comments

Comments
 (0)