Message151077
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). |
|
Date |
User |
Action |
Args |
2012-01-11 18:58:54 | neologix | set | recipients:
+ neologix, jcea, ncoghlan, pitrou, tarek, rosslagerwall, hynek |
2012-01-11 18:58:53 | neologix | link | issue13734 messages |
2012-01-11 18:58:52 | neologix | create | |
|