diff --git a/Doc/library/os.rst b/Doc/library/os.rst --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -2343,12 +2343,13 @@ *top* (including *top* itself), it yields a 3-tuple ``(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 ``'..'``). - *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 - ``os.path.join(dirpath, name)``. + *dirpath* is a string, the path to the directory. *dirnames* is a list of + the names of the subdirectories in *dirpath* (including symlinks to + directories, 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 ``os.path.join(dirpath, + name)``. If optional argument *topdown* is ``True`` or not specified, the triple for a directory is generated before the triples for any of its subdirectories diff --git a/Lib/os.py b/Lib/os.py --- a/Lib/os.py +++ b/Lib/os.py @@ -297,12 +297,13 @@ 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 '..'). - 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 - dirpath, do os.path.join(dirpath, name). + dirpath is a string, the path to the directory. dirnames is a list + of the names of the subdirectories in dirpath (including symlinks to + directories, 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 dirpath, do + os.path.join(dirpath, name). If optional arg 'topdown' is true or not specified, the triple for a directory is generated before the triples for any of its subdirectories