[issue20259] os.walk conflicts with os.listdir

2014-01-14 Thread R. David Murray
R. David Murray added the comment: That's not how Python works. If you print out currentDir, you will see that os.listdir is never called on the folder for which you do not have permission. That is, os.walk does indeed catch the listdir error, when *it* does the listdir, does not try to desc

[issue20259] os.walk conflicts with os.listdir

2014-01-14 Thread Shelby Spencer
New submission from Shelby Spencer: The problem occurs when you attempt to perform an os.listdir on a directory that you don't have access to. You should get an exception thrown. Normally this occurs, however, if you run the following code: folder = for currentDir, subDirs, files = os.walk(