gh-99127: Allow some features of syslog to the main interpreter only (gh-99128)

This commit is contained in:
Dong-hee Na 2022-11-30 07:58:20 +09:00 committed by GitHub
parent ed391090cc
commit 8bb2303fd7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 122 additions and 2 deletions

View file

@ -40,6 +40,13 @@ The module defines the following functions:
it wasn't called prior to the call to :func:`syslog`, deferring to the syslog
implementation to call ``openlog()``.
.. versionchanged:: 3.12
This function is restricted in subinterpreters.
(Only code that runs in multiple interpreters is affected and
the restriction is not relevant for most users.)
:func:`openlog` must be called in the main interpreter before :func:`syslog` may be used
in a subinterpreter. Otherwise it will raise :exc:`RuntimeError`.
.. function:: openlog([ident[, logoption[, facility]]])
@ -60,6 +67,13 @@ The module defines the following functions:
In previous versions, keyword arguments were not allowed, and *ident* was
required.
.. versionchanged:: 3.12
This function is restricted in subinterpreters.
(Only code that runs in multiple interpreters is affected and
the restriction is not relevant for most users.)
This may only be called in the main interpreter.
It will raise :exc:`RuntimeError` if called in a subinterpreter.
.. function:: closelog()
@ -72,6 +86,13 @@ The module defines the following functions:
.. audit-event:: syslog.closelog "" syslog.closelog
.. versionchanged:: 3.12
This function is restricted in subinterpreters.
(Only code that runs in multiple interpreters is affected and
the restriction is not relevant for most users.)
This may only be called in the main interpreter.
It will raise :exc:`RuntimeError` if called in a subinterpreter.
.. function:: setlogmask(maskpri)