Title: os.path.walk fails to descend into a directory whose name ends with a space
Type: Stage:
Components: Versions: Python 2.6
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, linuxelf, peter.otten
Priority: normal Keywords:

Created on 2009-04-24 17:36 by linuxelf, last changed 2009-04-24 22:19 by peter.otten. This issue is now closed.

Messages (3)
msg86418 - (view) Author: Stephen Gilbert (linuxelf) Date: 2009-04-24 17:36
I just ran into this using os.path.walk.  I noticed it wouldn't find
files inside a particular directory.  In debugging, I found that the
name of the directory was 'BBDO Atlanta '  os.path.walk would find the
directory, but wouldn't enter it.  I added a check inside my CallBack

if file[-1:] == ' ' and os.path.isdir(file):

and the script now traverses into the directory.
msg86434 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-04-24 21:18
os.path.walk is deprecated. You should use os.walk.
msg86436 - (view) Author: Peter Otten (peter.otten) * Date: 2009-04-24 22:19
Is "BBDO Atlanta " a symbolic link?. These are skipped by 
os.path.walk(). (The behaviour of os.walk() can be specified with the 
followsymlinks argument.)
Date User Action Args
2009-04-24 22:19:11peter.ottensetnosy: + peter.otten
messages: + msg86436
2009-04-24 21:18:23benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg86434

resolution: wont fix
2009-04-24 17:36:33linuxelfcreate