]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#7647: add ST_RDONLY, ST_NOSUID constants to os module.
authorAndrew M. Kuchling <amk@amk.ca>
Wed, 18 Aug 2010 22:30:34 +0000 (22:30 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Wed, 18 Aug 2010 22:30:34 +0000 (22:30 +0000)
(Also fix a name ordering in the ACKS file.)

Doc/library/os.rst
Doc/whatsnew/3.2.rst
Misc/ACKS
Misc/NEWS
Modules/posixmodule.c

index 3a7b599c3d7c770c03d85ec6b4fdaa88905d6ee0..9ab5fb19a8acc1e3e0f114cd8559d73e247db34d 100644 (file)
@@ -1342,6 +1342,14 @@ Files and Directories
    :attr:`f_bavail`, :attr:`f_files`, :attr:`f_ffree`, :attr:`f_favail`,
    :attr:`f_flag`, :attr:`f_namemax`.
 
+   Two module-level constants are defined for the :attr:`f_flag` attribute's
+   bit-flags: if :const:`ST_RDONLY` is set, the filesystem is mounted
+   read-only, and if :const:`ST_NOSUID` is set, the semantics of
+   setuid/setgid bits are disabled or not supported.
+
+   .. versionchanged:: 3.2
+      The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added.
+
    Availability: Unix.
 
 
index 1799b700850658a5d63d5ddadd4823d7a7786c2b..81cfa83c745921015f0270d8901bc2b254640195 100644 (file)
@@ -111,6 +111,10 @@ New, Improved, and Deprecated Modules
   programmer aware that his code contains object finalization issues.
   (Added by Antoine Pitrou; :issue:`477863`.)
 
+* The :mod:`os` module now has the :const:`ST_RDONLY` and :const:`ST_NOSUID`
+  constants, for use with the :func:`~os.statvfs` function.
+  (Patch by Adam Jackson; :issue:`7647`.)
+
 * The :func:`shutil.copytree` function has two new options:
 
   * *ignore_dangling_symlinks*: when ``symlinks=False`` (meaning that the
index 4ad93a3a88753b503dbefe48b39009c0299b4360..eef51e3e86bc61a1afa57c2971507d0fb147a016 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -389,8 +389,9 @@ Tony Ingraldi
 John Interrante
 Bob Ippolito
 Atsuo Ishimoto
-Paul Jackson
+Adam Jackson
 Ben Jackson
+Paul Jackson
 David Jacobs
 Kevin Jacobs
 Kjetil Jacobsen
index 5b2250873a666665d3601568809a8eccaabd2c1e..23245a8cb15251835d4b130e017bc2284cba7ba3 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -152,6 +152,9 @@ Library
   using the filesystem encoding and surrogateescape error handler. Patch
   written by David Watson.
 
+- Issue #7647: The posix module now has the ST_RDONLY and ST_NOSUID
+  constants, for use with the statvfs() function.  Patch by Adam Jackson.
+
 - Issue #8688: MANIFEST files created by distutils now include a magic
   comment indicating they are generated.  Manually maintained MANIFESTs
   without this marker will not be overwritten or removed.
index c36f7b421c1694641c0061a79d0168b2382f41be..ce625b4b54b869c66fd9315afee9653494c74dbe 100644 (file)
@@ -8169,6 +8169,14 @@ all_ins(PyObject *d)
     if (ins(d, "EX_NOTFOUND", (long)EX_NOTFOUND)) return -1;
 #endif /* EX_NOTFOUND */
 
+       /* statvfs */
+#ifdef ST_RDONLY
+       if (ins(d, "ST_RDONLY", (long)ST_RDONLY)) return -1;
+#endif /* ST_RDONLY */
+#ifdef ST_NOSUID
+       if (ins(d, "ST_NOSUID", (long)ST_NOSUID)) return -1;
+#endif /* ST_NOSUID */
+
 #ifdef HAVE_SPAWNV
 #if defined(PYOS_OS2) && defined(PYCC_GCC)
     if (ins(d, "P_WAIT", (long)P_WAIT)) return -1;