- for path, dirs, files in os.walk(root_path):
- for fname in files:
- yield os.path.join(path, fname)[root_len:].lstrip('/')
-
+ for path, dirs, files in os.walk(root_path, followlinks=True):
+ for fname in files:
+ if '\n' in fname: continue
+ yield os.path.join(path, fname)[root_len:].lstrip("/")