]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-57179: Add note on symlinks for os.walk (GH-94799)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 8 Oct 2022 03:15:08 +0000 (20:15 -0700)
committerGitHub <noreply@github.com>
Sat, 8 Oct 2022 03:15:08 +0000 (20:15 -0700)
(cherry picked from commit 0f498f1a95306995ca1e287f552c5c3d856be02d)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Doc/library/os.rst
Lib/os.py

index c8bb5a902d811c73d4f5d27ea91d6dd44e685f21..58f01e97459c3f6e43b419c201ef676bfc899827 100644 (file)
@@ -3135,7 +3135,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 d26cfc99939f390f6de2cf9e4f18a63a028b1425..4f2ffceaaf383556921b8d18c05998563eaff4bb 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