[issue28299] DirEntry.is_dir() evaluates True for a file on Windows

2016-09-28 Thread Zachary Ware
Changes by Zachary Ware : -- stage: -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue28299] DirEntry.is_dir() evaluates True for a file on Windows

2016-09-28 Thread Paul Moore
Paul Moore added the comment: is_dir is a *method*. To find out if an entry is a directory, you need to call it. So you need from os import DirEntry, scandir def test_is_dir(): for item in os.scandir(TEST_DIR): if item.is_dir(): # ^^ note change pri

[issue28299] DirEntry.is_dir() evaluates True for a file on Windows

2016-09-28 Thread David Staab
New submission from David Staab: 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: print(item.path)