New submission from Serhiy Storchaka <[email protected]>:
>>> os.stat('nul')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [WinError 1] Incorrect function: 'nul'
>>> os.stat('con')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [WinError 87] The parameter is incorrect: 'con'
But os.open() and os.fstat() work.
>>> os.fstat(os.open('nul', os.O_RDONLY))
os.stat_result(st_mode=8192, st_ino=0, st_dev=0, st_nlink=0, st_uid=0,
st_gid=0, st_size=0, st_atime=0, st_mtime=0, st_ctime=0)
>>> os.fstat(os.open('con', os.O_RDONLY))
os.stat_result(st_mode=8192, st_ino=0, st_dev=0, st_nlink=0, st_uid=0,
st_gid=0, st_size=0, st_atime=0, st_mtime=0, st_ctime=0)
----------
components: Windows
messages: 343745
nosy: paul.moore, serhiy.storchaka, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: os.stat() does not work for NUL and CON
type: behavior
versions: Python 2.7, Python 3.7, Python 3.8
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37074>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com