8000 gh-57179: Add note on symlinks for os.walk (GH-94799) · python/cpython@8d6591b · GitHub
[go: up one dir, main page]

Skip to content

Commit 8d6591b

Browse files
gh-57179: Add note on symlinks for os.walk (GH-94799)
(cherry picked from commit 0f498f1) Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
1 parent 46aa5d2 commit 8d6591b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Doc/library/os.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3208,7 +3208,8 @@ features:
32083208
filenames)``.
32093209

32103210
*dirpath* is a string, the path to the directory. *dirnames* is a list of the
3211-
names of the subdirectories in *dirpath* (excluding ``'.'`` and ``'..'``).
3211+
names of the subdirectories in *dirpath* (including symlinks to directories,
3212+
and excluding ``'.'`` and ``'..'``).
32123213
*filenames* is a list of the names of the non-directory files in *dirpath*.
32133214
Note that the names in the lists contain no path components. To get a full path
32143215
(which begins with *top*) to a file or directory in *dirpath*, do

Lib/os.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ def walk(top, topdown=True, onerror=None, followlinks=False):
288288
dirpath, dirnames, filenames
289289
290290
dirpath is a string, the path to the directory. dirnames is a list of
291-
the names of the subdirectories in dirpath (excluding '.' and '..').
291+
the names of the subdirectories in dirpath (including symlinks to directories,
292+
and excluding '.' and '..').
292293
filenames is a list of the names of the non-directory files in dirpath.
293294
Note that the names in the lists are just names, with no path components.
294295
To get a full path (which begins with top) to a file or directory in

0 commit comments

Comments
 (0)
0