[docs] [issue12970] os.wlak() consider some symlinks as dirs instead of non-dirs

Марк Коренберг report at bugs.python.org
Tue Sep 13 15:16:05 CEST 2011

Марк Коренберг <socketpair at gmail.com> added the comment:

Also, there is some mis-optimisation for followlinks=False: stat() and then lstat() will be called. Instead of one lstat().

Code may be rewritten as (but I don't know about cross-platform issues):
if followlinks:
    mode = os.stat(path).st_mode
    mode = os.lstat(path).st_mode

if stat.S_ISDIR(mode):
It will be much cleaner than current (or patched with my patch) implementation


Python tracker <report at bugs.python.org>

More information about the docs mailing list