Title: os.fstat() fails on FAT32 file system on Windows · Issue #111856 · python/cpython · GitHub
Open Graph Title: os.fstat() fails on FAT32 file system on Windows · Issue #111856 · python/cpython
X Title: os.fstat() fails on FAT32 file system on Windows · Issue #111856 · python/cpython
Description: Bug report Bug description: This is Python 3.12.0 x64 running on Windows 11. On a FAT32 drive, I have a file f.txt. >>> import os >>> os.stat('f.txt') os.stat_result(st_mode=33206, st_ino=4194560, st_dev=1589430838, st_nlink=1, st_uid=0,...
Open Graph Description: Bug report Bug description: This is Python 3.12.0 x64 running on Windows 11. On a FAT32 drive, I have a file f.txt. >>> import os >>> os.stat('f.txt') os.stat_result(st_mode=33206, st_ino=4194560, ...
X Description: Bug report Bug description: This is Python 3.12.0 x64 running on Windows 11. On a FAT32 drive, I have a file f.txt. >>> import os >>> os.stat('f.txt') os.stat_result(st_mo...
Opengraph URL: https://github.com/python/cpython/issues/111856
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"os.fstat() fails on FAT32 file system on Windows","articleBody":"# Bug report\n\n### Bug description:\n\nThis is Python 3.12.0 x64 running on Windows 11. On a FAT32 drive, I have a file `f.txt`.\n\n```python\n\u003e\u003e\u003e import os\n\u003e\u003e\u003e os.stat('f.txt')\nos.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)\n\u003e\u003e\u003e f = open('f.txt','rb')\n\u003e\u003e\u003e f.fileno()\n3\n\u003e\u003e\u003e os.fstat(f.fileno())\nTraceback (most recent call last):\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nOSError: [WinError 87] The parameter is incorrect\n```\n\nThis error does not occur with Python 3.11.6. I suspect that the issue was introduced with https://github.com/python/cpython/pull/102149. https://github.com/python/cpython/commit/6031727a37c6003f78e3b0c7414a0a214855dd08 provided a fix for `os.stat()`, but it seems that an equivalent bug exists for `os.fstat()`.\n\nI believe the fix would involve changing the line https://github.com/python/cpython/blob/74b868f636a8af9e5540e3315de666500147d47a/Python/fileutils.c#L1275C48-L1275C48 to account for the possibility that the file system does not support `FileIdInfo`.\n\n### CPython versions tested on:\n\n3.12\n\n### Operating systems tested on:\n\nWindows\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-112038\n* gh-112044\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/adang1345","@type":"Person","name":"adang1345"},"datePublished":"2023-11-08T16:21:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/111856/cpython/issues/111856"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bed96bfb-54bb-6271-d141-d0d41f32ef93 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9EEA:1B7E6F:14D8CA:1D1C49:696A636A |
| html-safe-nonce | 75766fbd2b1fef4799b27fae9daca63f9b21b6b6f5aecc54cea2345d3fc0e1bf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RUVBOjFCN0U2RjoxNEQ4Q0E6MUQxQzQ5OjY5NkE2MzZBIiwidmlzaXRvcl9pZCI6IjQ0MDgyMzQ3OTgwNjg5NDk4NjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7af9e87d27f96ef1668e835a61b4ef74aa737d35d64e4ca3a9db8972f5c41aec |
| hovercard-subject-tag | issue:1983968356 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/111856/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1242e952948079abcc74d4eadc2c54aaf98723ef5fbbb4534cd02392f4750e35/python/cpython/issues/111856 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1242e952948079abcc74d4eadc2c54aaf98723ef5fbbb4534cd02392f4750e35/python/cpython/issues/111856 |
| og:image:alt | Bug report Bug description: This is Python 3.12.0 x64 running on Windows 11. On a FAT32 drive, I have a file f.txt. >>> import os >>> os.stat('f.txt') os.stat_result(st_mode=33206, st_ino=4194560, ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | adang1345 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9b7735a184970dd9333b2cbe036c8f3c0a9108c64aaa93827c5a64fc70993392 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 87cbd411c2982752221b5751d583a515b23bf5fa |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width