homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ukl
Recipients Sung-Yu.Chen, alexey-smirnov, docs@python, ncoghlan, socketpair, ukl, vstinner
Date 2014年07月17日.20:20:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1405628459.1.0.827845109344.issue12970@psf.upfronthosting.co.za>
In-reply-to
Content
I like the function as it is documented, i.e. "filenames is a list of the names of the non-directory files in dirpath.". This includes all symlinks (in the followlinks=False cast at least).
I'd say not including symlinks to directories but symlinks to files is a magnitude more surprising than treating a symlink to a directory as a file. And if you consider this as a short comming of the documentation this isn't (IMHO) a subtlety. The (my?) intuition says: all entries of a root (apart from . and .. as documented) are included in either dirnames or filenames.
Yes, changing behaviour here might break some code, but this applies to all changes.
For some usecases it might be right to just skip over symlinks-to-dirs, but if it's not you have to opendir + read all root entries again in the loop to find all symlinks which effectively means reimplementing os.walk.
History
Date User Action Args
2014年07月17日 20:20:59uklsetrecipients: + ukl, ncoghlan, vstinner, docs@python, socketpair, alexey-smirnov, Sung-Yu.Chen
2014年07月17日 20:20:59uklsetmessageid: <1405628459.1.0.827845109344.issue12970@psf.upfronthosting.co.za>
2014年07月17日 20:20:59ukllinkissue12970 messages
2014年07月17日 20:20:58uklcreate

AltStyle によって変換されたページ (->オリジナル) /