Author David Staab
Recipients David Staab, paul.moore, steve.dower, tim.golden, zach.ware
Date 2016-09-28.12:47:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I'm using Python 3.5.2 on Windows 10 Pro to run the following code with the attached file structure.

The test code is:
from os import DirEntry, scandir

def test_is_dir():
    for item in os.scandir(TEST_DIR):
        if item.is_dir:

TEST_DIR = '.'

The console output is:
Connected to pydev debugger (build 162.1967.10)

Process finished with exit code 0

I would expect to only see '.\20160707', but "if item.is_dir:" always evaluates to True.

I notice that changing the import line to "from os import DirEntry, scandir" yields the exception "ImportError: cannot import name 'DirEntry'".
Date User Action Args
2016-09-28 12:47:27David Staabsetrecipients: + David Staab, paul.moore, tim.golden, zach.ware, steve.dower
2016-09-28 12:47:27David Staabsetmessageid: <>
2016-09-28 12:47:27David Staablinkissue28299 messages
2016-09-28 12:47:27David Staabcreate