This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: DirEntry returns invalid values for is_dir and is_file on NFS
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Nicolas SURRIBAS
Priority: normal Keywords:

Created on 2022-01-06 15:57 by Nicolas SURRIBAS, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg409869 - (view) Author: Nicolas SURRIBAS (Nicolas SURRIBAS) Date: 2022-01-06 15:57
Hello,

I bumped into this strange behavior several times when using os.scandir on mounted NFS shares. I'm using Python 3.9.1

>>> path = b'/mnt/nfs_share/sdb1/System Volume Information/'
>>> l = list(os.scandir(path))
>>> print(l[2].name)
b'WPSettings.dat'
>>> print(l[2].path)
b'/mnt/nfs_share/sdb1/System Volume Information/WPSettings.dat'
>>> print(l[2].is_file())
False
>>> print(l[2].is_dir())
True
>>> print(os.path.isfile(l[2].path))
True
>>> print(os.path.isdir(l[2].path))
False
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90442
2022-01-06 15:57:09Nicolas SURRIBAScreate