-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Add statvfs flags to the posix module #51896
Comments
Though the statvfs call exists in the posix module, the posix-defined values for the f_flag field are not. This makes it hard to know whether a filesystem is readonly without also knowing the value for ST_READONLY on the machine you're running on. Attached patch is against python2 svn, but probably applies to python3 too. |
IMO these symbols should go to the "stat" module, not the "posix" module. However, that module is Python, so the values would need to be hardcoded. Do you know whether they are constant on all relevant systems? |
I think having a stat module is a mistake in the first place. It's primary purpose (giving symbolic names to fields in a stat result) is out-of-date, now that we have named tuples. It's secondary purpose (collecting symbolic constants and macros around them) is flawed, as there is no guarantee that they are fixed across systems (unless we explicitly map the values correspondingly. So I support addition of the constants to the posix module. Not sure whether documentation is lacking in the patch (i.e. whether they ought to be documented). |
Okay. Would it then make sense to migrate those constants in the stat module to posix, and deprecate the former? |
None of the other symbolic constants in 'posix' have documentation. Perhaps they should, but the patch is at least doing the same as what's already done. |
Here's a patch that updates the 2.7 docs. Adam, have you submitted a contributor agreement (http://www.python.org/psf/contrib/)? |
Committed to 3.2 in rev. 84188; thanks, Adam! |
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: