cpython: cbe7560d4443 (original) (raw)

Mercurial > cpython

changeset 76951:cbe7560d4443

#14773: Fix os.fwalk() failing on dangling symlinks [#14773]

Hynek Schlawack hs@ox.cx
date Tue, 15 May 2012 16:32:21 +0200
parents d4c590cee68b
children cdea40514623
files Lib/os.py Lib/test/test_os.py Misc/NEWS
diffstat 3 files changed, 24 insertions(+), 8 deletions(-)[+] [-] Lib/os.py 24 Lib/test/test_os.py 6 Misc/NEWS 2

line wrap: on

line diff

--- a/Lib/os.py +++ b/Lib/os.py @@ -353,13 +353,23 @@ if _exists("openat"): names = flistdir(topfd) dirs, nondirs = [], [] for name in names:

if topdown: yield toppath, dirs, nondirs, topfd

--- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -651,6 +651,7 @@ class WalkTests(unittest.TestCase): # SUB2/ a file kid and a dirsymlink kid # tmp3 # link/ a symlink to TESTFN.2

@@ -663,6 +664,8 @@ class WalkTests(unittest.TestCase): link_path = join(sub2_path, "link") t2_path = join(support.TESTFN, "TEST2") tmp4_path = join(support.TESTFN, "TEST2", "tmp4")

# Create stuff. os.makedirs(sub11_path) @@ -679,7 +682,8 @@ class WalkTests(unittest.TestCase): else: symlink_to_dir = os.symlink symlink_to_dir(os.path.abspath(t2_path), link_path)

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -31,6 +31,8 @@ Core and Builtins Library ------- +- Issue 14773: Fix os.fwalk() failing on dangling symlinks. +