Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #23 from jbraeuer/master

Follow symlinks, when requested, drop recursion detection.
  • Loading branch information...
commit add5f2bc840c47bafef1c2faaf8470e889300a52 2 parents fc4f740 + 22c60c1
@mludvig mludvig authored
Showing with 2 additions and 8 deletions.
  1. +2 −8 S3/FileLists.py
View
10 S3/FileLists.py
@@ -24,18 +24,12 @@ def _fswalk_follow_symlinks(path):
If a recursive directory link is detected, emit a warning and skip.
'''
assert os.path.isdir(path) # only designed for directory argument
- walkdirs = set([path])
- targets = set()
+ walkdirs = [path]
for dirpath, dirnames, filenames in os.walk(path):
for dirname in dirnames:
current = os.path.join(dirpath, dirname)
- target = os.path.realpath(current)
if os.path.islink(current):
- if target in targets:
- warning("Skipping recursively symlinked directory %s" % dirname)
- else:
- walkdirs.add(current)
- targets.add(target)
+ walkdirs.append(current)
for walkdir in walkdirs:
for value in os.walk(walkdir):
yield value
Please sign in to comment.
Something went wrong with that request. Please try again.