Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Bug description:
This is Python 3.12.0 x64 running on Windows 11. On a FAT32 drive, I have a filef.txt.
>>>importos>>>os.stat('f.txt')os.stat_result(st_mode=33206,st_ino=4194560,st_dev=1589430838,st_nlink=1,st_uid=0,st_gid=0,st_size=0,st_atime=1699419600,st_mtime=1699459266,st_ctime=1699459265)>>>f=open('f.txt','rb')>>>f.fileno()3>>>os.fstat(f.fileno())Traceback (mostrecentcalllast):File"<stdin>",line1,in<module>OSError: [WinError87]Theparameterisincorrect
This error does not occur with Python 3.11.6. I suspect that the issue was introduced with#102149.6031727 provided a fix foros.stat(), but it seems that an equivalent bug exists foros.fstat().
I believe the fix would involve changing the linehttps://github.com/python/cpython/blob/74b868f636a8af9e5540e3315de666500147d47a/Python/fileutils.c#L1275C48-L1275C48 to account for the possibility that the file system does not supportFileIdInfo.
CPython versions tested on:
3.12
Operating systems tested on:
Windows