2014-07-14 4:17 GMT+02:00 Nick Coghlan <ncogh...@gmail.com>: > Or the ever popular symlink to "." (or a directory higher in the tree).
"." and ".." are explicitly ignored by os.listdir() an os.scandir(). > I think os.walk() is a good source of inspiration here: call the flag > "followlink" and default it to False. IMO the specific function os.walk() is not a good example. It includes symlinks to directories in the dirs list and then it does not follow symlink, it is a recursive function and has a followlinks optional parameter (default: False). Moreover, in 92% of cases, functions using os.listdir() and os.path.isdir() *follow* symlinks: https://mail.python.org/pipermail/python-dev/2014-July/135435.html Victor _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com