Declare the following functions as macros, since they are actually
macros. It avoids a warning on "TYPE" or "macro" argument.
* PyMem_New()
* PyMem_Resize()
* PyModule_AddIntMacro()
* PyModule_AddStringMacro()
* PyObject_GC_New()
* PyObject_GC_NewVar()
* PyObject_New()
* PyObject_NewVar()
Add C standard C types to nitpick_ignore in Doc/conf.py:
* int64_t
* uint64_t
* uintptr_t
No longer ignore non existing "__int" type in nitpick_ignore.
Update Doc/tools/.nitignore.
(cherry picked from commit 8d61a71f9c)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-106723: forward -Xfrozen_modules option to spawned process interpreters (GH-106724)
(cherry picked from commit 3dcac78581)
Co-authored-by: Felipe A. Hernandez <ergoithz@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gh-104621: Check for Incompatible Extensions in import_find_extension() (gh-107184)
This fixes a bug where incompatible modules could still be imported if attempted multiple times.
(cherry picked from commit 75c974f535)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
gh-104432: Use `memcpy()` to avoid misaligned loads (GH-104433)
Fix potential unaligned memory access on C APIs involving returned sequences
of `char *` pointers within the :mod:`grp` and :mod:`socket` modules. These
were revealed using a ``-fsaniziter=alignment`` build on ARM macOS.
(cherry picked from commit f01e4cedba)
Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
gh-105699: Disable the Interpreters Stress Tests (gh-107354)
The two tests are crashing periodically in CI and on buildbots. I suspect the problem is in the _xxsubinterpreters module.
Regardless, I'm disabling the tests temporarily, to reduce the noise as we approach 3.12rc1. I'll be investigating the crashes separately.
(cherry picked from commit 4f67921ad2)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
The _xxsubinterpreters module was meant to only use public API. Some internal C-API usage snuck in over the last few years (e.g. gh-28969). This fixes that.
(cherry picked from commit e6373c0d8b)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Bump some docs dependencies to resolve a Dependabot security alert (GH-107341)
(cherry picked from commit f84d77b4e0)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Add targets for PyStructSequence_Desc and PyStructSequence_Field members
and macros like Py_EQ.
Fix target for Py_RETURN_RICHCOMPARE.
(cherry picked from commit abec9a1b20)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Instead, order the tutorial as one body of prose, making it easier to
align the tutorial according to Diátaxis principles.
(cherry picked from commit 592395577c)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
gh-105002: [pathlib] Fix relative_to with walk_up=True using ".." (GH-107014)
It makes sense to raise an Error because ".." can not
be resolved and the current working directory is unknown.
(cherry picked from commit e7e6e4b035)
Co-authored-by: János Kukovecz <kukoveczjanos@gmail.com>
Document that `os.link()` is not available on Emscripten (GH-104822)
(cherry picked from commit 737d1da074)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
gh-106948: Update documentation nitpick_ignore for c:identifer domain (GH-107295)
Update the nitpick_ignore of the documentation configuration to fix
Sphinx warnings about standard C types when declaring functions with
the "c:function" markups.
Copy standard C types declared in the "c:type" domain to the
"c:identifier" domain, since "c:function" markup looks for types in
the "c:identifier" domain.
(cherry picked from commit b1de3807b8)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-105699: Add some stress tests for subinterpreter creation (GH-106966)
(cherry picked from commit adda43dc0b)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
gh-105059: Fix MSCV compiler warning on PyObject union (GH-107239)
Use pragma to ignore the MSCV compiler warning on the PyObject
nameless union.
(cherry picked from commit 1c8fe9bdb6)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-107237: Fix test_udp_reconnection() of test_logging (GH-107238)
test_logging: Fix test_udp_reconnection() by increasing the timeout
from 100 ms to 5 minutes (LONG_TIMEOUT).
Replace also blocking wait() with wait(LONG_TIMEOUT) in
test_output() to prevent the test to hang.
(cherry picked from commit ed08238327)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-105059: Use GCC/clang extension for PyObject union (GH-107232)
Anonymous union is new in C11. To prevent compiler warning
when using -pedantic compiler option, use Clang and GCC
extension on C99 and older.
(cherry picked from commit 6261585d63)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-98608: Move PyInterpreterConfig to pylifecycle.h (GH-107191)
Move PyInterpreterConfig structure and associated macros from
initconfig.h to pylifecycle.h: it's not related to the Python
Initialization Configuration.
(cherry picked from commit e717b47ed8)
Co-authored-by: Victor Stinner <vstinner@python.org>
GH-96803: Move PyUnstable_InterpreterFrame_GetCode() to Python.h (GH-107188)
Declare the following 3 PyUnstable functions in
Include/cpython/pyframe.h rather than Include/cpython/frameobject.h,
so they are now provided by the standard "GH-include <Python.h>".
(cherry picked from commit 837fa5c0cd)
Co-authored-by: Victor Stinner <vstinner@python.org>
Instead of hacking into the Clinic class, use the Argument Clinic tool
to run the ClinicExternalTest test suite.
(cherry picked from commit 83a2837b32)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Fix PyVectorcall_Function doc versionadded (GH-107140)
The documentation implies that PyVectorcall_Function() was available in Python 3.8.
This is half-true - it was available under a different name. I think it's clearer to set
the "version added" to 3.9.
(cherry picked from commit 0a9b339363)
Co-authored-by: da-woods <dw-git@d-woods.co.uk>