closes bpo-25461: Update os.walk() docstring to match the online docs. (GH-11836)

(cherry picked from commit 734f1202a5)

Co-authored-by: Bernt Røskar Brenna <bernt.brenna@gmail.com>
This commit is contained in:
Miss Islington (bot) 2019-09-10 06:21:57 -07:00 committed by GitHub
parent c3008dd480
commit c43f26eca3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -300,10 +300,11 @@ def walk(top, topdown=True, onerror=None, followlinks=False):
(e.g., via del or slice assignment), and walk will only recurse into the (e.g., via del or slice assignment), and walk will only recurse into the
subdirectories whose names remain in dirnames; this can be used to prune the subdirectories whose names remain in dirnames; this can be used to prune the
search, or to impose a specific order of visiting. Modifying dirnames when search, or to impose a specific order of visiting. Modifying dirnames when
topdown is false is ineffective, since the directories in dirnames have topdown is false has no effect on the behavior of os.walk(), since the
already been generated by the time dirnames itself is generated. No matter directories in dirnames have already been generated by the time dirnames
the value of topdown, the list of subdirectories is retrieved before the itself is generated. No matter the value of topdown, the list of
tuples for the directory and its subdirectories are generated. subdirectories is retrieved before the tuples for the directory and its
subdirectories are generated.
By default errors from the os.scandir() call are ignored. If By default errors from the os.scandir() call are ignored. If
optional arg 'onerror' is specified, it should be a function; it optional arg 'onerror' is specified, it should be a function; it