[issue28041] Inconsistent behavior: Get st_nlink from os.stat() and os.scandir()

2017-04-21 Thread STINNER Victor
STINNER Victor added the comment: scandir () is designed for effiency, not for portability or correctness. The API has deliberate limitations which are well documented, as the one you spotted: https://docs.python.org/dev/library/os.html#os.DirEntry.stat Your PR would defeat the whole purpose

[issue28041] Inconsistent behavior: Get st_nlink from os.stat() and os.scandir()

2017-03-23 Thread Josh Rosenberg
Josh Rosenberg added the comment: This is documented behavior. Per the docs for os.DirEntry's stat method (the objects yielded by os.scandir): >On Windows, the st_ino, st_dev and st_nlink attributes of the stat_result are >always set to zero. Call os.stat() to get these attributes. It might

[issue28041] Inconsistent behavior: Get st_nlink from os.stat() and os.scandir()

2017-03-23 Thread Mark Becwar
Changes by Mark Becwar : -- pull_requests: +700 ___ Python tracker ___ ___

[issue28041] Inconsistent behavior: Get st_nlink from os.stat() and os.scandir()

2016-09-09 Thread Mohanson Leaf
New submission from Mohanson Leaf: os.stat(file).st_nlink gives 1 but same file's st_nlink from os.scandir(dir) gives 0. """ Inconsistent behavior: Get st_nlink from os.stat() and os.scandir() Platform: Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:38:48) [MSC v.1900 32 bit (Intel)] on