New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop HAVE_FSTAT: require fstat() to compile/use Python #67941
Comments
Topic previously discussed at: Related issue: Antoine Pitrou wrote in the issue: I agree. I'm quite sure that Python doesn't work on such platform, and it would require much more changes than just making fstat optional. So I'm in favor of dropping the check on fstat() and expect it to be always available. Examples of Python modules of the standard library using os.fstat:
|
stat.patch: Stop pretending that Python works without stat() nor fstat(), consider that these functions are always available. |
See bpo-22623 for moving in opposite direction. |
My changes only *removes* code and so make it simpler ;-) $ diffstat stat.patch
Include/fileutils.h | 6 Include/pyport.h | 22 ---------------------- |
+1 from me, fstat() has always been par of POSIX. |
See also bpo-12082. |
Yes, but I don't think we want to clutter the code to support exotic |
Antoine and Charles-François are in favor of removing these #ifdef. Serhiy wrote:
Not exactly, Link Mauve wrote "On those two platforms, fstat() is correctly defined and works fine, so it shouldn’t be a problem to drop its #ifdef." |
New changeset a84eae63b4cd by Victor Stinner in branch 'default': |
This doesn't look correct. An equivalent replacement is -#if defined(HAVE_STAT) && !defined(MS_WINDOWS) |
New changeset ad5521dd7b80 by Victor Stinner in branch 'default': |
Oh, I missed the "!". Only _Py_wstat() uses this test. Windows has _wstat(), so _Py_wstat() could use it. I added deliberately "!defined(MS_WINDOWS)" because _Py_wstat() is only used in Modules/getpath.c and this file is not compiled on Windows. Instead of modifying _Py_wstat(), I moved it back to Modules/getpath.c. There is no need to overengineer this function only called 3 times in getpath.c. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: