[issue46284] DirEntry returns invalid values for is_dir and is_file on NFS

Nicolas SURRIBAS report at bugs.python.org
Thu Jan 6 10:57:10 EST 2022


New submission from Nicolas SURRIBAS <nicolas.surribas at gmail.com>:

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

----------
components: Library (Lib)
messages: 409869
nosy: Nicolas SURRIBAS
priority: normal
severity: normal
status: open
title: DirEntry returns invalid values for is_dir and is_file on NFS
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46284>
_______________________________________


More information about the Python-bugs-list mailing list