[issue22524] PEP 471 implementation: os.scandir() directory scanning function

STINNER Victor report at bugs.python.org
Thu Feb 12 18:25:51 CET 2015


STINNER Victor added the comment:

Patch version 5:

- Use None value for the d_type instead of DT_UNKNOW to *prepare* support for platforms where the dirent structure has no d_type field. Serhiy guess that such platform have no DT_xxx constant neither. DirEntry doesn't DT_xxx constants if d_type is None

- Fix test_removed_file() and test_removed_dir() tests if d_type is unknown (I tested manually by forcing d_type to None)

- Use os.lstat() instead of os.stat(follow_symlinks=False) in DirEntry.inode(), it's a little bit faster even if it's the same syscall. The cost probably comes from the code parsing Python parameters, especially the keyword

----------
Added file: http://bugs.python.org/file38113/scandir-5.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22524>
_______________________________________


More information about the Python-bugs-list mailing list