[New-bugs-announce] [issue5832] os.path.walk fails to descend into a directory whose name ends with a space

Stephen Gilbert report at bugs.python.org
Fri Apr 24 19:36:35 CEST 2009


New submission from Stephen Gilbert <linuxelf at gmail.com>:

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.

----------
messages: 86418
nosy: linuxelf
severity: normal
status: open
title: os.path.walk fails to descend into a directory whose name ends with a space
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5832>
_______________________________________


More information about the New-bugs-announce mailing list