Skip to content
Merged
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
22 changes: 1 addition & 21 deletions pep-0587.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,19 +239,12 @@ The ``PyPreConfig`` structure is used to preinitialize Python:
* Configure the LC_CTYPE locale
* Set the UTF-8 mode

The ``struct_size`` field must be explicitly initialized to
``sizeof(PyPreConfig)``.

Example using the preinitialization to enable the UTF-8 Mode::

PyStatus status;
PyPreConfig preconfig;
preconfig.struct_size = sizeof(PyPreConfig);

status = PyPreConfig_InitPythonConfig(&preconfig);
if (PyStatus_Exception(status)) {
Py_ExitStatusException(status);
}
PyPreConfig_InitPythonConfig(&preconfig);

preconfig.utf8_mode = 1;

Expand Down Expand Up @@ -327,9 +320,6 @@ an effect on the pre-configuration like encodings. For example, the
``Py_PreInitializeFromBytesArgs()`` parse their ``argv`` argument the
same way the regular Python parses command line arguments: see
`Command Line Arguments`_.
* ``struct_size`` (``size_t``:
Size of the structure in bytes: must be initialized to
``sizeof(PyPreConfig)``. Field used for API and ABI compatibility.
* ``use_environment`` (``int``):
See ``PyConfig.use_environment``.
* ``utf8_mode`` (``int``):
Expand Down Expand Up @@ -359,16 +349,12 @@ Initialization with PyConfig

The ``PyConfig`` structure contains most parameters to configure Python.

The ``struct_size`` field must be explicitly initialized to
``sizeof(PyConfig)``.

Example setting the program name::

void init_python(void)
{
PyStatus status;
PyConfig config;
config.struct_size = sizeof(PyConfig);

status = PyConfig_InitPythonConfig(&config);
if (PyStatus_Exception(status)) {
Expand Down Expand Up @@ -571,9 +557,6 @@ exceptions (error or exit) using ``PyStatus_Exception()`` and
``stdio_errors`` (``wchar_t*``):
Encoding and encoding errors of ``sys.stdin``, ``sys.stdout``
and ``sys.stderr``.
* ``struct_size`` (``size_t``:
Size of the structure in bytes: must be initialized to
``sizeof(PyConfig)``. Field used for API and ABI compatibility.
* ``tracemalloc`` (``int``):
If non-zero, call ``tracemalloc.start(value)``.
* ``user_site_directory`` (``int``):
Expand Down Expand Up @@ -614,7 +597,6 @@ configuration, and then override some parameters::
{
PyStatus status;
PyConfig config;
config.struct_size = sizeof(PyConfig);

status = PyConfig_InitPythonConfig(&config);
if (PyStatus_Exception(status)) {
Expand Down Expand Up @@ -703,7 +685,6 @@ Example of customized Python always running in isolated mode::
{
PyStatus status;
PyConfig config;
config.struct_size = sizeof(PyConfig);

status = PyConfig_InitPythonConfig(&config);
if (PyStatus_Exception(status)) {
Expand Down Expand Up @@ -879,7 +860,6 @@ phases::
{
PyStatus status;
PyConfig config;
config.struct_size = sizeof(PyConfig);

status = PyConfig_InitPythonConfig(&config);
if (PyStatus_Exception(status)) {
Expand Down