[issue27084] Add dir_fd and follow_symlinks kwargs to os.listdir and os.scandir

Evgeny Kapun report at bugs.python.org
Sun May 22 18:25:35 EDT 2016


Evgeny Kapun added the comment:

Mostly for consistency with other functions. Also, this provides an easy way to walk a directory tree recursively: just call listdir on every member, and if it doesn't raise OSError, that member must be a directory. With follow_symlinks=False, this method wouldn't follow symlinks, unlike os.walk and os.fwalk, which always follow symlinks at least to differentiate between symlinks to directories and other symlinks.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27084>
_______________________________________


More information about the Python-bugs-list mailing list