gh-57179: Add note on symlinks for os.walk (#94799)

This commit is contained in:
Stanley 2022-10-07 15:51:50 -07:00 committed by GitHub
parent a54a69989e
commit 0f498f1a95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -3222,7 +3222,8 @@ features:
filenames)``.
*dirpath* is a string, the path to the directory. *dirnames* is a list of the
names of the subdirectories in *dirpath* (excluding ``'.'`` and ``'..'``).
names of the subdirectories in *dirpath* (including symlinks to directories,
and excluding ``'.'`` and ``'..'``).
*filenames* is a list of the names of the non-directory files in *dirpath*.
Note that the names in the lists contain no path components. To get a full path
(which begins with *top*) to a file or directory in *dirpath*, do

View File

@ -288,7 +288,8 @@ def walk(top, topdown=True, onerror=None, followlinks=False):
dirpath, dirnames, filenames
dirpath is a string, the path to the directory. dirnames is a list of
the names of the subdirectories in dirpath (excluding '.' and '..').
the names of the subdirectories in dirpath (including symlinks to directories,
and excluding '.' and '..').
filenames is a list of the names of the non-directory files in dirpath.
Note that the names in the lists are just names, with no path components.
To get a full path (which begins with top) to a file or directory in