diff options
| author | Stanley <46876382+slateny@users.noreply.github.com> | 2022-10-07 22:51:50 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-07 22:51:50 (GMT) |
| commit | 0f498f1a95306995ca1e287f552c5c3d856be02d (patch) | |
| tree | 834bdbb19cea3b9376de0043056e4afb28f711ef | |
| parent | a54a69989eade3589459d15def53b3c4f21b7551 (diff) | |
| download | cpython-0f498f1a95306995ca1e287f552c5c3d856be02d.zip cpython-0f498f1a95306995ca1e287f552c5c3d856be02d.tar.gz cpython-0f498f1a95306995ca1e287f552c5c3d856be02d.tar.bz2 | |
gh-57179: Add note on symlinks for os.walk (#94799)
| -rw-r--r-- | Doc/library/os.rst | 3 | ||||
| -rw-r--r-- | Lib/os.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 23b014b..8727f81 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -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 @@ -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 |
