mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-57179: Add note on symlinks for os.walk (GH-94799)
(cherry picked from commit 0f498f1a95)
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
This commit is contained in:
parent
1a31799d16
commit
1818235f40
2 changed files with 4 additions and 2 deletions
|
|
@ -3135,7 +3135,8 @@ features:
|
||||||
filenames)``.
|
filenames)``.
|
||||||
|
|
||||||
*dirpath* is a string, the path to the directory. *dirnames* is a list of the
|
*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*.
|
*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
|
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
|
(which begins with *top*) to a file or directory in *dirpath*, do
|
||||||
|
|
|
||||||
|
|
@ -288,7 +288,8 @@ def walk(top, topdown=True, onerror=None, followlinks=False):
|
||||||
dirpath, dirnames, filenames
|
dirpath, dirnames, filenames
|
||||||
|
|
||||||
dirpath is a string, the path to the directory. dirnames is a list of
|
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.
|
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.
|
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
|
To get a full path (which begins with top) to a file or directory in
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue