Skip to content

Commit

Permalink
pythongh-57179: Add note on symlinks for os.walk (pythonGH-94799)
Browse files Browse the repository at this point in the history
(cherry picked from commit 0f498f1)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
  • Loading branch information
slateny authored and miss-islington committed Oct 7, 2022
1 parent 9dea4e2 commit 0322ccc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3208,7 +3208,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
Expand Down
3 changes: 2 additions & 1 deletion Lib/os.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0322ccc

Please sign in to comment.