Message152805
| Author |
ncoghlan |
| Recipients |
Sung-Yu.Chen, alexey-smirnov, docs@python, ncoghlan, socketpair, vstinner |
| Date |
2012年02月07日.11:54:26 |
| SpamBayes Score |
1.0437708e-06 |
| Marked as misclassified |
No |
| Message-id |
<1328615667.67.0.554991283436.issue12970@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
This behaviour came up recently when implementing os.fwalk() [1]. There are problems with all 3 possible approaches (list as dirs, list as files, don't list at all) when followlinks is False. Since all alternatives are potentially surprising, the current behaviour wins by default (as people will already have written their code to cope with that behaviour and there's no net gain in changing the default, since the desired treatment of such links will vary according to the task at hand).
As a result, I'm converting this to a pure documentation issue - the os.walk() docs should definitely mention this subtlety. The behaviour won't be changing, though.
[1] http://bugs.python.org/issue13734,#msg151077 |
|