mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #28353: os.fwalk() no longer fails on broken links.
This commit is contained in:
commit
af4e4747f5
3 changed files with 22 additions and 4 deletions
|
@ -481,13 +481,13 @@ if {open, stat} <= supports_dir_fd and {listdir, stat} <= supports_fd:
|
|||
dirs.append(name)
|
||||
else:
|
||||
nondirs.append(name)
|
||||
except FileNotFoundError:
|
||||
except OSError:
|
||||
try:
|
||||
# Add dangling symlinks, ignore disappeared files
|
||||
if st.S_ISLNK(stat(name, dir_fd=topfd, follow_symlinks=False)
|
||||
.st_mode):
|
||||
nondirs.append(name)
|
||||
except FileNotFoundError:
|
||||
except OSError:
|
||||
continue
|
||||
|
||||
if topdown:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue