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.

Author hynek
Recipients hynek, javahaxxor, ronaldoussoren
Date 2012-06-02.16:01:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1338652868.6.0.918352108319.issue14985@psf.upfronthosting.co.za>
In-reply-to
Content
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') will return ["bar"]. Calling os.isdir('bar') will return False because it can't find the file.

Have a look at os.walk() which was written with your use case in mind.
History
Date User Action Args
2012-06-02 16:01:08hyneksetrecipients: + hynek, ronaldoussoren, javahaxxor
2012-06-02 16:01:08hyneksetmessageid: <1338652868.6.0.918352108319.issue14985@psf.upfronthosting.co.za>
2012-06-02 16:01:08hyneklinkissue14985 messages
2012-06-02 16:01:07hynekcreate