This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Add statvfs flags to the posix module
Type: enhancement Stage:
Components: Extension Modules Versions: Python 3.2, Python 2.7
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: loewis Nosy List:, akuchling, dmalcolm, georg.brandl, loewis
Priority: normal Keywords: patch

Created on 2010-01-06 20:18 by, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
posix-statvfs-symbols.patch, 2010-01-06 20:18 posix-statvfs-symbols.patch
posix-statvfs-flag-docs.txt akuchling, 2010-02-22 20:07 Documentation patch
Messages (7)
msg97322 - (view) Author: Adam Jackson ( Date: 2010-01-06 20:18
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.
msg97449 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-01-09 09:40
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?
msg97452 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-01-09 10:03
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).
msg97453 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-01-09 10:22
Okay.  Would it then make sense to migrate those constants in the stat module to posix, and deprecate the former?
msg97657 - (view) Author: Adam Jackson ( Date: 2010-01-12 21:10
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.
msg99821 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2010-02-22 20:07
Here's a patch that updates the 2.7 docs.

Adam, have you submitted a contributor agreement (
msg114291 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2010-08-18 22:46
Committed to 3.2 in rev. 84188; thanks, Adam!
Date User Action Args
2022-04-11 14:56:56adminsetgithub: 51896
2010-08-18 22:46:31akuchlingsetstatus: open -> closed
resolution: accepted
messages: + msg114291
2010-02-22 20:07:18akuchlingsetfiles: + posix-statvfs-flag-docs.txt
nosy: + akuchling
messages: + msg99821

2010-01-12 21:10:21ajax@redhat.comsetmessages: + msg97657
2010-01-09 10:22:24georg.brandlsetmessages: + msg97453
2010-01-09 10:03:22loewissetmessages: + msg97452
2010-01-09 09:40:04georg.brandlsetassignee: loewis

messages: + msg97449
nosy: + loewis, georg.brandl
2010-01-06 20:35:26dmalcolmsetnosy: + dmalcolm
2010-01-06 20:18:59ajax@redhat.comsettype: enhancement
2010-01-06 20:18:18ajax@redhat.comcreate