@@ -445,6 +445,8 @@ process and user.
445
445
On some platforms, including FreeBSD and Mac OS X, setting ``environ `` may
446
446
cause memory leaks. Refer to the system documentation for :c:func: `putenv `.
447
447
448
+ .. audit-event :: os.putenv key,value os.putenv
449
+
448
450
.. versionchanged :: 3.9
449
451
The function is now always available.
450
452
@@ -640,6 +642,8 @@ process and user.
640
642
don't update ``os.environ ``, so it is actually preferable to delete items of
641
643
``os.environ ``.
642
644
645
+ .. audit-event :: os.unsetenv key os.unsetenv
646
+
643
647
.. versionchanged :: 3.9
644
648
The function is now always available and is also available on Windows.
645
649
@@ -766,6 +770,8 @@ as internal buffering of data.
766
770
docs for :func: `chmod ` for possible values of *mode *. As of Python 3.3, this
767
771
is equivalent to ``os.chmod(fd, mode) ``.
768
772
773
+ .. audit-event :: os.chmod path,mode,dir_fd os.fchmod
774
+
769
775
.. availability :: Unix.
770
776
771
777
@@ -776,6 +782,8 @@ as internal buffering of data.
776
782
:func: `chown `. As of Python 3.3, this is equivalent to ``os.chown(fd, uid,
777
783
gid) ``.
778
784
785
+ .. audit-event :: os.chown path,uid,gid,dir_fd os.fchown
786
+
779
787
.. availability :: Unix.
780
788
781
789
@@ -883,6 +891,8 @@ as internal buffering of data.
883
891
:data: `F_ULOCK ` or :data: `F_TEST `.
884
892
*len * specifies the section of the file to lock.
885
893
894
+ .. audit-event :: os.lockf fd,cmd,len os.lockf
895
+
886
896
.. availability :: Unix.
887
897
888
898
.. versionadded :: 3.3
@@ -1603,6 +1613,8 @@ features:
1603
1613
This function can raise :exc: `OSError ` and subclasses such as
1604
1614
:exc: `FileNotFoundError `, :exc: `PermissionError `, and :exc: `NotADirectoryError `.
1605
1615
1616
+ .. audit-event :: os.chdir path os.chdir
1617
+
1606
1618
.. versionadded :: 3.3
1607
1619
Added support for specifying *path * as a file descriptor
1608
1620
on some platforms.
@@ -1631,6 +1643,8 @@ features:
1631
1643
1632
1644
This function can support :ref: `not following symlinks <follow_symlinks >`.
1633
1645
1646
+ .. audit-event :: os.chflags path,flags os.chflags
1647
+
1634
1648
.. availability :: Unix.
1635
1649
1636
1650
.. versionadded :: 3.3
@@ -1676,6 +1690,8 @@ features:
1676
1690
read-only flag with it (via the ``stat.S_IWRITE `` and ``stat.S_IREAD ``
1677
1691
constants or a corresponding integer value). All other bits are ignored.
1678
1692
1693
+ .. audit-event :: os.chmod path,mode,dir_fd os.chmod
1694
+
1679
1695
.. versionadded :: 3.3
1680
1696
Added support for specifying *path * as an open file descriptor,
1681
1697
and the *dir_fd * and *follow_symlinks * arguments.
@@ -1696,6 +1712,8 @@ features:
1696
1712
See :func: `shutil.chown ` for a higher-level function that accepts names in
1697
1713
addition to numeric ids.
1698
1714
1715
+ .. audit-event :: os.chown path,uid,gid,dir_fd os.chown
1716
+
1699
1717
.. availability :: Unix.
1700
1718
1701
1719
.. versionadded :: 3.3
@@ -1722,6 +1740,8 @@ features:
1722
1740
descriptor *fd *. The descriptor must refer to an opened directory, not an
1723
1741
open file. As of Python 3.3, this is equivalent to ``os.chdir(fd) ``.
1724
1742
1743
+ .. audit-event :: os.chdir path os.fchdir
1744
+
1725
1745
.. availability :: Unix.
1726
1746
1727
1747
@@ -1746,6 +1766,8 @@ features:
1746
1766
not follow symbolic links. As of Python 3.3, this is equivalent to
1747
1767
``os.chflags(path, flags, follow_symlinks=False) ``.
1748
1768
1769
+ .. audit-event :: os.chflags path,flags os.lchflags
1770
+
1749
1771
.. availability :: Unix.
1750
1772
1751
1773
.. versionchanged :: 3.6
@@ -1759,6 +1781,8 @@ features:
1759
1781
for possible values of *mode *. As of Python 3.3, this is equivalent to
1760
1782
``os.chmod(path, mode, follow_symlinks=False) ``.
1761
1783
1784
+ .. audit-event :: os.chmod path,mode,dir_fd os.lchmod
1785
+
1762
1786
.. availability :: Unix.
1763
1787
1764
1788
.. versionchanged :: 3.6
@@ -1770,6 +1794,8 @@ features:
1770
1794
function will not follow symbolic links. As of Python 3.3, this is equivalent
1771
1795
to ``os.chown(path, uid, gid, follow_symlinks=False) ``.
1772
1796
1797
+ .. audit-event :: os.chown path,uid,gid,dir_fd os.lchown
1798
+
1773
1799
.. availability :: Unix.
1774
1800
1775
1801
.. versionchanged :: 3.6
@@ -1784,6 +1810,8 @@ features:
1784
1810
supply :ref: `paths relative to directory descriptors <dir_fd >`, and :ref: `not
1785
1811
following symlinks <follow_symlinks>`.
1786
1812
1813
+ .. audit-event :: os.link src,dst,src_dir_fd,dst_dir_fd os.link
1814
+
1787
1815
.. availability :: Unix, Windows.
1788
1816
1789
1817
.. versionchanged :: 3.2
@@ -1886,6 +1914,8 @@ features:
1886
1914
It is also possible to create temporary directories; see the
1887
1915
:mod: `tempfile ` module's :func: `tempfile.mkdtemp ` function.
1888
1916
1917
+ .. audit-event :: os.mkdir path,mode,dir_fd os.mkdir
1918
+
1889
1919
.. versionadded :: 3.3
1890
1920
The *dir_fd * argument.
1891
1921
@@ -1918,6 +1948,8 @@ features:
1918
1948
1919
1949
This function handles UNC paths correctly.
1920
1950
1951
+ .. audit-event :: os.mkdir path,mode,dir_fd os.makedirs
1952
+
1921
1953
.. versionadded :: 3.2
1922
1954
The *exist_ok * parameter.
1923
1955
@@ -2083,6 +2115,8 @@ features:
2083
2115
2084
2116
This function is semantically identical to :func: `unlink `.
2085
2117
2118
+ .. audit-event :: os.remove path,dir_fd os.remove
2119
+
2086
2120
.. versionadded :: 3.3
2087
2121
The *dir_fd * argument.
2088
2122
@@ -2103,6 +2137,8 @@ features:
2103
2137
they are empty. Raises :exc: `OSError ` if the leaf directory could not be
2104
2138
successfully removed.
2105
2139
2140
+ .. audit-event :: os.remove path,dir_fd os.removedirs
2141
+
2106
2142
.. versionchanged :: 3.6
2107
2143
Accepts a :term: `path-like object `.
2108
2144
@@ -2128,6 +2164,8 @@ features:
2128
2164
2129
2165
If you want cross-platform overwriting of the destination, use :func: `replace `.
2130
2166
2167
+ .. audit-event :: os.rename src,dst,src_dir_fd,dst_dir_fd os.rename
2168
+
2131
2169
.. versionadded :: 3.3
2132
2170
The *src_dir_fd * and *dst_dir_fd * arguments.
2133
2171
@@ -2147,6 +2185,8 @@ features:
2147
2185
This function can fail with the new directory structure made if you lack
2148
2186
permissions needed to remove the leaf directory or file.
2149
2187
2188
+ .. audit-event :: os.rename src,dst,src_dir_fd,dst_dir_fd os.renames
2189
+
2150
2190
.. versionchanged :: 3.6
2151
2191
Accepts a :term: `path-like object ` for *old * and *new *.
2152
2192
@@ -2162,6 +2202,8 @@ features:
2162
2202
This function can support specifying *src_dir_fd * and/or *dst_dir_fd * to
2163
2203
supply :ref: `paths relative to directory descriptors <dir_fd >`.
2164
2204
2205
+ .. audit-event :: os.rename src,dst,src_dir_fd,dst_dir_fd os.replace
2206
+
2165
2207
.. versionadded :: 3.3
2166
2208
2167
2209
.. versionchanged :: 3.6
@@ -2178,6 +2220,8 @@ features:
2178
2220
This function can support :ref: `paths relative to directory descriptors
2179
2221
<dir_fd>`.
2180
2222
2223
+ .. audit-event :: os.rmdir path,dir_fd os.rmdir
2224
+
2181
2225
.. versionadded :: 3.3
2182
2226
The *dir_fd * parameter.
2183
2227
@@ -2821,6 +2865,8 @@ features:
2821
2865
:exc: `OSError ` is raised when the function is called by an unprivileged
2822
2866
user.
2823
2867
2868
+ .. audit-event :: os.symlink src,dst,dir_fd os.symlink
2869
+
2824
2870
.. availability :: Unix, Windows.
2825
2871
2826
2872
.. versionchanged :: 3.2
@@ -2873,6 +2919,8 @@ features:
2873
2919
traditional Unix name. Please see the documentation for
2874
2920
:func: `remove ` for further information.
2875
2921
2922
+ .. audit-event :: os.remove path,dir_fd os.unlink
2923
+
2876
2924
.. versionadded :: 3.3
2877
2925
The *dir_fd * parameter.
2878
2926
@@ -2910,6 +2958,8 @@ features:
2910
2958
:ref: `paths relative to directory descriptors <dir_fd >` and :ref: `not
2911
2959
following symlinks <follow_symlinks>`.
2912
2960
2961
+ .. audit-event :: os.utime path,times,ns,dir_fd os.utime
2962
+
2913
2963
.. versionadded :: 3.3
2914
2964
Added support for specifying *path * as an open file descriptor,
2915
2965
and the *dir_fd *, *follow_symlinks *, and *ns * parameters.
@@ -3135,6 +3185,8 @@ These functions are all available on Linux only.
3135
3185
This function can support :ref: `specifying a file descriptor <path_fd >` and
3136
3186
:ref: `not following symlinks <follow_symlinks >`.
3137
3187
3188
+ .. audit-event :: os.getxattr path,attribute os.getxattr
3189
+
3138
3190
.. versionchanged :: 3.6
3139
3191
Accepts a :term: `path-like object ` for *path * and *attribute *.
3140
3192
@@ -3149,6 +3201,8 @@ These functions are all available on Linux only.
3149
3201
This function can support :ref: `specifying a file descriptor <path_fd >` and
3150
3202
:ref: `not following symlinks <follow_symlinks >`.
3151
3203
3204
+ .. audit-event :: os.listxattr path os.listxattr
3205
+
3152
3206
.. versionchanged :: 3.6
3153
3207
Accepts a :term: `path-like object `.
3154
3208
@@ -3163,6 +3217,8 @@ These functions are all available on Linux only.
3163
3217
This function can support :ref: `specifying a file descriptor <path_fd >` and
3164
3218
:ref: `not following symlinks <follow_symlinks >`.
3165
3219
3220
+ .. audit-event :: os.removexattr path,attribute os.removexattr
3221
+
3166
3222
.. versionchanged :: 3.6
3167
3223
Accepts a :term: `path-like object ` for *path * and *attribute *.
3168
3224
@@ -3186,6 +3242,8 @@ These functions are all available on Linux only.
3186
3242
A bug in Linux kernel versions less than 2.6.39 caused the flags argument
3187
3243
to be ignored on some filesystems.
3188
3244
3245
+ .. audit-event :: os.setxattr path,attribute,value,flags os.setxattr
3246
+
3189
3247
.. versionchanged :: 3.6
3190
3248
Accepts a :term: `path-like object ` for *path * and *attribute *.
3191
3249
@@ -3248,6 +3306,8 @@ to be ignored.
3248
3306
<https://msdn.microsoft.com/44228cf2-6306-466c-8f16-f513cd3ba8b5> `_
3249
3307
for more information about how DLLs are loaded.
3250
3308
3309
+ .. audit-event :: os.add_dll_directory path os.add_dll_directory
3310
+
3251
3311
.. availability :: Windows.
3252
3312
3253
3313
.. versionadded :: 3.8
@@ -3480,6 +3540,8 @@ written in Python, such as a mail server's external command delivery program.
3480
3540
Note that some platforms including FreeBSD <= 6.3 and Cygwin have
3481
3541
known issues when using ``fork() `` from a thread.
3482
3542
3543
+ .. audit-event :: os.fork "" os.fork
3544
+
3483
3545
.. versionchanged :: 3.8
3484
3546
Calling ``fork() `` in a subinterpreter is no longer supported
3485
3547
(:exc: `RuntimeError ` is raised).
@@ -3499,6 +3561,8 @@ written in Python, such as a mail server's external command delivery program.
3499
3561
master end of the pseudo-terminal. For a more portable approach, use the
3500
3562
:mod: `pty ` module. If an error occurs :exc: `OSError ` is raised.
3501
3563
3564
+ .. audit-event :: os.forkpty "" os.forkpty
3565
+
3502
3566
.. versionchanged :: 3.8
3503
3567
Calling ``forkpty() `` in a subinterpreter is no longer supported
3504
3568
(:exc: `RuntimeError ` is raised).
@@ -3525,6 +3589,8 @@ written in Python, such as a mail server's external command delivery program.
3525
3589
3526
3590
See also :func: `signal.pthread_kill `.
3527
3591
3592
+ .. audit-event :: os.kill pid,sig os.kill
3593
+
3528
3594
.. versionadded :: 3.2
3529
3595
Windows support.
3530
3596
@@ -3537,6 +3603,8 @@ written in Python, such as a mail server's external command delivery program.
3537
3603
3538
3604
Send the signal *sig * to the process group *pgid *.
3539
3605
3606
+ .. audit-event :: os.killpg pgid,sig os.killpg
3607
+
3540
3608
.. availability :: Unix.
3541
3609
3542
3610
0 commit comments