[issue14985] os.path.isfile and os.path.isdir inconsistent on OSX Lion

2012-06-02 Thread Adrian Bastholm
Adrian Bastholm added the comment: You're right, my code was shite. Strange though it seemed to work on some files. The following updated version does everything as intended with the help of os.path.join: def traverse (targetDir): currentDir = targetDir dirs = os.listdir(targetDir)

[issue14985] os.path.isfile and os.path.isdir inconsistent on OSX Lion

2012-06-02 Thread Hynek Schlawack
Hynek Schlawack added the comment: I think your problem is a different one: os.listdir() doesn't return full paths and os.path.isfile()/isdir() return False if the supplied path doesn't exist. For example if you have this directory structure: foo/ foo/bar/ foo/bar/baz Calling os.listdir('foo

[issue14985] os.path.isfile and os.path.isdir inconsistent on OSX Lion

2012-06-02 Thread Adrian Bastholm
New submission from Adrian Bastholm : os.path.isfile doesn't reckognize a .picasa.ini file as a file and os.path.isdir doesn't reckognize a directory as a directory code: def traverse (targetDir): currentDir = targetDir dirs = os.listdir(targetDir) #dirs = [x for x in os.listdir('.'