changeset: 100454:19a3e0e664af branch: 3.4 parent: 100408:0cae6b6e3d7d user: Serhiy Storchaka date: Tue Mar 08 16:11:26 2016 +0200 files: Lib/test/test_os.py description: Issues #23808, #25911: Trying to fix walk tests on Windows. On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag. diff -r 0cae6b6e3d7d -r 19a3e0e664af Lib/test/test_os.py --- a/Lib/test/test_os.py Thu Mar 03 22:05:36 2016 -0800 +++ b/Lib/test/test_os.py Tue Mar 08 16:11:26 2016 +0200 @@ -770,7 +770,11 @@ if support.can_symlink(): os.symlink(os.path.abspath(t2_path), self.link_path) os.symlink('broken', broken_link_path, True) - self.sub2_tree = (sub2_path, ["link"], ["broken_link", "tmp3"]) + if os.path.isdir(broken_link_path): + # On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag. + self.sub2_tree = (sub2_path, ["broken_link", "link"], ["tmp3"]) + else: + self.sub2_tree = (sub2_path, ["link"], ["broken_link", "tmp3"]) else: self.sub2_tree = (sub2_path, [], ["tmp3"])