Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP 741: Fix typos #3924

Merged
merged 1 commit into from
Aug 26, 2024
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
26 changes: 8 additions & 18 deletions peps/pep-0741.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Security fix

To fix `CVE-2020-10735
<https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10735>`_,
a denial-of-service when converting very a large string to an integer (in base
a denial-of-service when converting a very large string to an integer (in base
10), it was discussed to add a new ``PyConfig`` member to stable
branches which affects the ABI.

Expand Down Expand Up @@ -230,7 +230,7 @@ These C API functions are excluded from the limited C API.
PyInitConfig structure
----------------------

The ``PyInitConfig`` structure is implemented by combining the four
The ``PyInitConfig`` structure is implemented by combining the three
structures of the ``PyConfig`` API and has an ``inittab`` member as
well:

Expand Down Expand Up @@ -352,7 +352,7 @@ dictionary (``key: str`` → ``value: str | True``).
Read-only configuration options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Following options can be get ``PyConfig_Get()``, but cannot be set by
Following options can be get by ``PyConfig_Get()``, but cannot be set by
``PyConfig_Set()``.

.. list-table::
Expand Down Expand Up @@ -427,7 +427,7 @@ Following options can be get ``PyConfig_Get()``, but cannot be set by
-
* - ``legacy_windows_stdio``
- ``bool``
- Windows only
- Windows only.
* - ``malloc_stats``
- ``bool``
-
Expand Down Expand Up @@ -667,9 +667,7 @@ Error Handling
* Return ``0`` if *config* has no exit code set.

Only the ``Py_InitializeFromInitConfig()`` function can set an exit
code if the ``parse_argv`` option is non-zero. For example, an
isolated configuration cannot set an exit code by default, since
``parse_argv`` is zero by default.
code if the ``parse_argv`` option is non-zero.

An exit code can be set when parsing the command line failed (exit
code 2) or when a command line option asks to display the command
Expand Down Expand Up @@ -758,8 +756,8 @@ Examples
Initialize Python
-----------------

Example initializing Python, set configuration options of different types,
return -1 on error:
Example initializing Python, set configuration options of various types,
return ``-1`` on error:

.. code-block:: c

Expand All @@ -777,7 +775,6 @@ return -1 on error:
}

// Set a list of UTF-8 strings (argv)
// Preinitialize implicitly Python to decode the bytes string.
char *argv[] = {"my_program", "-c", "pass"};
if (PyInitConfig_SetStrList(config, "argv",
Py_ARRAY_LENGTH(argv), argv) < 0) {
Expand All @@ -789,13 +786,6 @@ return -1 on error:
goto error;
}

// Set a list of UTF-8 strings (xoptions).
char* xoptions[] = {"faulthandler"};
if (PyInitConfig_SetStrList(config, "xoptions",
Py_ARRAY_LENGTH(xoptions), xoptions) < 0) {
goto error;
}

// Initialize Python with the configuration
if (Py_InitializeFromInitConfig(config) < 0) {
goto error;
Expand Down Expand Up @@ -824,7 +814,7 @@ configuration:

int config_bytes_warning(PyInitConfig *config)
{
int bytes_warning;
int64_t bytes_warning;
if (PyInitConfig_GetInt(config, "bytes_warning", &bytes_warning)) {
return -1;
}
Expand Down
Loading