def _fswalk_follow_symlinks(path):
 assert os.path.isdir(deunicodise(path))
 walkdirs = set([path])
 for (dirpath, dirnames, filenames) in _os_walk_unicode(path):
  real_dirpath = unicodise(os.path.realpath(deunicodise(dirpath)))
  for dirname in dirnames:
   current = os.path.join(dirpath, dirname)
   real_current = unicodise(os.path.realpath(deunicodise(current)))
   if os.path.islink(deunicodise(current)):
    if ((real_dirpath == real_current) or real_dirpath.startswith((real_current + os.path.sep))):
     warning(('Skipping recursively symlinked directory %s' % dirname))
    else:
     walkdirs.add(current)
 for walkdir in walkdirs:
  for (dirpath, dirnames, filenames) in _os_walk_unicode(walkdir):
   (yield (dirpath, dirnames, filenames))

def _fswalk_follow_symlinks ( path ) : assert os . path . isdir ( deunicodise ( path ) ) walkdirs = set ( [ path ] ) for ( dirpath , dirnames , filenames ) in _os_walk_unicode ( path ) : real_dirpath = unicodise ( os . path . realpath ( deunicodise ( dirpath ) ) ) for dirname in dirnames : current = os . path . join ( dirpath , dirname ) real_current = unicodise ( os . path . realpath ( deunicodise ( current ) ) ) if os . path . islink ( deunicodise ( current ) ) : if ( ( real_dirpath == real_current ) or real_dirpath . startswith ( ( real_current + os . path . sep ) ) ) : warning ( ( 'Skipping recursively symlinked directory %s' % dirname ) ) else : walkdirs . add ( current ) for walkdir in walkdirs : for ( dirpath , dirnames , filenames ) in _os_walk_unicode ( walkdir ) : ( yield ( dirpath , dirnames , filenames ) )
walk filesystem .