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.

classification
Title: os.path.walk fails to descend into a directory whose name ends with a space
Type: Stage:
Components: Versions: Python 2.6
process
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 2022-04-11 14:56 by admin. 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
function:

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

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.)
History
Date User Action Args
2022-04-11 14:56:48adminsetgithub: 50082
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