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 neologix
Recipients hynek, jcea, ncoghlan, neologix, pitrou, rosslagerwall, tarek
Date 2012-01-11.18:58:52
SpamBayes Score 1.110223e-16
Marked as misclassified No
Message-id <CAH_1eM2H0EAW7GfH078+97y35W1ey5hH1djugmCmnXDF39x8Ow@mail.gmail.com>
In-reply-to <CAH_1eM3u2gcQzvW42oq2ARB2GXwS3aOzFQNAYU0Y-oVc03qRGQ@mail.gmail.com>
Content
Here's an updated version.

Note that I'm not pushing towards changing the current behavior
pertaining to symlinks to directories, because if we change this, this
will break code.
For example to count the number of lines of all the files under a
directory, a code could go like this:

for root, dirs, files in os.walk(top):
    for file in files:
        f = open(file)
        for n, l in enumerate(f, 1):
            pass
        print(file, n)

If, suddently, a symlink to a directory appeared in files, this will
break. So I'm not convinced it's worth changing this. A symlink to a
directory is not much closer to a file than to a directory, it really
depends on the use case.
I'm also fine with keeping fdwalk() consistent with this to make
porting easier (and also because it makes it easy to test, I just have
to compare fdwlak()'s output to walk()'s output).
Files
File name Uploaded
fdwalk-1.diff neologix, 2012-01-11.18:58:51
History
Date User Action Args
2012-01-11 18:58:54neologixsetrecipients: + neologix, jcea, ncoghlan, pitrou, tarek, rosslagerwall, hynek
2012-01-11 18:58:53neologixlinkissue13734 messages
2012-01-11 18:58:52neologixcreate