]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-57179: Add note on symlinks for os.walk (#94799)
authorStanley <46876382+slateny@users.noreply.github.com>
Fri, 7 Oct 2022 22:51:50 +0000 (15:51 -0700)
committerGitHub <noreply@github.com>
Fri, 7 Oct 2022 22:51:50 +0000 (15:51 -0700)
Doc/library/os.rst
Lib/os.py

index 23b014b0b65924e9d20e63761978a3c1ac4ef106..8727f811def1c09ce3e781ca7e9f8a89a62516a9 100644 (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
index 648188e0f13490efade8c6a74f5db76b50186e38..fd1e774fdcbcfa579f0c4457ac489daec8c104aa 100644 (file)
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -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