Message152805
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 |
|
Date |
User |
Action |
Args |
2012-02-07 11:54:27 | ncoghlan | set | recipients:
+ ncoghlan, vstinner, docs@python, socketpair, alexey-smirnov, Sung-Yu.Chen |
2012-02-07 11:54:27 | ncoghlan | set | messageid: <1328615667.67.0.554991283436.issue12970@psf.upfronthosting.co.za> |
2012-02-07 11:54:27 | ncoghlan | link | issue12970 messages |
2012-02-07 11:54:26 | ncoghlan | create | |
|