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