This is due to a memory leak detected in os.path.isdir; see Huge memory leak on os.path.isdir repeated calls? You can verify this yourself using a Unicode encoded path string - there should be no leakage.
os.path.isdir is used in the implementation of os.walk:
islink, join, isdir = path.islink, path.join, path.isdir try: names = listdir(top) except error, err: if onerror is not None: onerror(err) return dirs, nondirs = [], [] for name in names: if isdir(join(top, name)): dirs.append(name) else: nondirs.append(name)
AAlon source share