Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,19 @@ Initializing and finalizing the interpreter
the table of loaded modules (``sys.modules``), and creates the fundamental
modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It also initializes
the module search path (``sys.path``). It does not set ``sys.argv``; use
:c:func:`PySys_SetArgvEx` for that. This is a no-op when called for a second time
(without calling :c:func:`Py_FinalizeEx` first). There is no return value; it is a
:c:func:`PySys_SetArgvEx` for that. There is no return value; it is a
fatal error if the initialization fails.

.. note::
On Windows, changes the console mode from ``O_TEXT`` to ``O_BINARY``, which will
also affect non-Python uses of the console using the C Runtime.

.. versionchanged:: 3.7

Calling :c:func:`Py_Initialize` or :c:func:`Py_InitializeEx` a second
time without an intervening call to :c:func:`Py_FinalizeEx` is deprecated
and is expected to become an error in a future release.


.. c:function:: void Py_InitializeEx(int initsigs)

Expand Down
8 changes: 6 additions & 2 deletions Doc/whatsnew/3.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2415,7 +2415,7 @@ In preparation for potential future changes to the public CPython runtime
initialization API (see :pep:`432` for an initial, but somewhat outdated,
draft), CPython's internal startup
and configuration management logic has been significantly refactored. While
these updates are intended to be entirely transparent to both embedding
these updates are intended to be almost entirely transparent to both embedding
applications and users of the regular CPython CLI, they're being mentioned
here as the refactoring changes the internal order of various operations
during interpreter startup, and hence may uncover previously latent defects,
Expand All @@ -2430,7 +2430,11 @@ number of other issues). Some known details affected:

* warnings filters added by an embedding application with
:c:func:`PySys_AddWarnOption` should now more consistently take precedence
over the default filters set by the interpreter
over the default filters set by the interpreter.

* calling :c:func:`Py_InitializeEx` a second time (directly or indirectly)
without an intervening call to :c:func:`Py_FinalizeEx` is now deprecated,
and is expected to become an error in a future release.

Due to changes in the way the default warnings filters are configured,
setting :c:data:`Py_BytesWarningFlag` to a value greater than one is no longer
Expand Down