[New-bugs-announce] [issue14985] os.path.isfile and os.path.isdir inconsistent on OSX Lion

Adrian Bastholm report at bugs.python.org
Sat Jun 2 15:06:53 CEST 2012

New submission from Adrian Bastholm <javahaxxor at gmail.com>:

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


def traverse (targetDir):
    currentDir = targetDir
    dirs = os.listdir(targetDir)
#    dirs = [x for x in os.listdir('.') if x.endswith('.JPG')]
    for entry in dirs:
        if os.path.isdir(entry):
            print("Traversing " + entry)
            print("Not dir: " + entry)
            if os.path.isfile(entry):
                print("Processing " + " " + currentDir + " " + entry)
                print("Not file: " + entry)
    return True

The test directory contains jpg files and a folder with some other jpgs and a subfolder containing jpgs

assignee: ronaldoussoren
components: Macintosh
messages: 162133
nosy: javahaxxor, ronaldoussoren
priority: normal
severity: normal
status: open
title: os.path.isfile and os.path.isdir  inconsistent on OSX Lion
type: behavior
versions: Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list