Skip to content
This repository
Browse code

Merge pull request #23 from jbraeuer/master

Follow symlinks, when requested, drop recursion detection.
  • Loading branch information...
commit add5f2bc840c47bafef1c2faaf8470e889300a52 2 parents fc4f740 + 22c60c1
Michal Ludvig authored

Showing 1 changed file with 2 additions and 8 deletions. Show diff stats Hide diff stats

  1. 10  S3/FileLists.py
10  S3/FileLists.py
@@ -24,18 +24,12 @@ def _fswalk_follow_symlinks(path):
24 24
         If a recursive directory link is detected, emit a warning and skip.
25 25
         '''
26 26
         assert os.path.isdir(path) # only designed for directory argument
27  
-        walkdirs = set([path])
28  
-        targets = set()
  27
+        walkdirs = [path]
29 28
         for dirpath, dirnames, filenames in os.walk(path):
30 29
                 for dirname in dirnames:
31 30
                         current = os.path.join(dirpath, dirname)
32  
-                        target = os.path.realpath(current)
33 31
                         if os.path.islink(current):
34  
-                                if target in targets:
35  
-                                        warning("Skipping recursively symlinked directory %s" % dirname)
36  
-                                else:
37  
-                                        walkdirs.add(current)
38  
-                        targets.add(target)
  32
+				walkdirs.append(current)
39 33
         for walkdir in walkdirs:
40 34
                 for value in os.walk(walkdir):
41 35
                         yield value

0 notes on commit add5f2b

Please sign in to comment.
Something went wrong with that request. Please try again.