]> granicus.if.org Git - python/commitdiff
Fixed a bug in os.walk() with bytes path on Windows caused by merging fixes
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 24 Feb 2016 11:03:54 +0000 (13:03 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Wed, 24 Feb 2016 11:03:54 +0000 (13:03 +0200)
for issues #25995 and #25911.

Lib/os.py

index a49e7ce45603de5e238b0e063e5ca94255d8474e..e32cd6be32e63a34122b2d3f9a9ba5dc06d326a2 100644 (file)
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -369,7 +369,7 @@ def walk(top, topdown=True, onerror=None, followlinks=False):
             # Note that scandir is global in this module due
             # to earlier import-*.
             scandir_it = scandir(top)
-        entries = list(scandir(top))
+        entries = list(scandir_it)
     except OSError as error:
         if onerror is not None:
             onerror(error)