diff options
author | Hynek Schlawack <hs@ox.cx> | 2012-05-15 14:32:21 (GMT) |
---|---|---|
committer | Hynek Schlawack <hs@ox.cx> | 2012-05-15 14:32:21 (GMT) |
commit | 66bfcc1b0f3b1eb4905b3ef1054b8afc1219aacb (patch) | |
tree | dab98c23d5c524b1ceb61bb1a6d89efec416ddbc /Lib/test | |
parent | 0fb41b56ea1415943569ee6dda1c9d1aec952c37 (diff) | |
download | cpython-66bfcc1b0f3b1eb4905b3ef1054b8afc1219aacb.zip cpython-66bfcc1b0f3b1eb4905b3ef1054b8afc1219aacb.tar.gz cpython-66bfcc1b0f3b1eb4905b3ef1054b8afc1219aacb.tar.bz2 |
#14773: Fix os.fwalk() failing on dangling symlinks
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_os.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 066bf72..1e0daf0 100644 --- 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 + # broken_link # TEST2/ # tmp4 a lone file walk_path = join(support.TESTFN, "TEST1") @@ -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") + link_path = join(sub2_path, "link") + broken_link_path = join(sub2_path, "broken_link") # 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) - sub2_tree = (sub2_path, ["link"], ["tmp3"]) + symlink_to_dir('broken', broken_link_path) + sub2_tree = (sub2_path, ["link"], ["broken_link", "tmp3"]) else: sub2_tree = (sub2_path, [], ["tmp3"]) |