Skip to content

Commit b01303a

Browse files
author
Erlend E. Aasland
committed
Merge branch 'main' into sqlite-extended-error-codes
2 parents 26517fc + 762a4dc commit b01303a

1,270 files changed

Lines changed: 22581 additions & 9282 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ name: Tests
44
# it prevents to mark a job as mandatory. A PR cannot be merged if a job is
55
# mandatory but not scheduled because of "paths-ignore".
66
on:
7+
workflow_dispatch:
78
push:
89
branches:
910
- 'main'
@@ -85,7 +86,9 @@ jobs:
8586
- name: Check limited ABI symbols
8687
run: make check-limited-abi
8788
- name: Check Autoconf version 2.69
88-
run: grep "Generated by GNU Autoconf 2.69" configure
89+
run: |
90+
grep "Generated by GNU Autoconf 2.69" configure
91+
grep "PKG_PROG_PKG_CONFIG" aclocal.m4
8992
9093
build_win32:
9194
name: 'Windows (x86)'
@@ -126,8 +129,12 @@ jobs:
126129
PYTHONSTRICTEXTENSIONBUILD: 1
127130
steps:
128131
- uses: actions/checkout@v2
132+
- name: Prepare homebrew environment variables
133+
run: |
134+
echo "LDFLAGS=-L$(brew --prefix tcl-tk)/lib" >> $GITHUB_ENV
135+
echo "PKG_CONFIG_PATH=$(brew --prefix openssl@1.1)/lib/pkgconfig:$(brew --prefix tcl-tk)/lib/pkgconfig" >> $GITHUB_ENV
129136
- name: Configure CPython
130-
run: ./configure --with-pydebug --with-openssl=/usr/local/opt/openssl --prefix=/opt/python-dev
137+
run: ./configure --with-pydebug --prefix=/opt/python-dev
131138
- name: Build CPython
132139
run: make -j4
133140
- name: Display build info
@@ -267,4 +274,4 @@ jobs:
267274
- name: Display build info
268275
run: make pythoninfo
269276
- name: Tests
270-
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu -x test_ctypes test_crypt test_decimal test_faulthandler test_interpreters test___all__ test_idle test_tix test_tk test_ttk_guionly test_ttk_textonly"
277+
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu -x test_ctypes test_crypt test_decimal test_faulthandler test_interpreters test___all__ test_idle test_tix test_tk test_ttk_guionly test_ttk_textonly test_multiprocessing_fork test_multiprocessing_forkserver test_multiprocessing_spawn"

.github/workflows/build_msi.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: TestsMSI
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- 'main'

.github/workflows/doc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Docs
22

33
on:
4+
workflow_dispatch:
45
#push:
56
# branches:
67
# - 'main'

.github/workflows/posix-deps-apt.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ apt-get update
33

44
apt-get -yq install \
55
build-essential \
6+
pkg-config \
67
ccache \
78
gdb \
89
lcov \

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ Tools/unicode/data/
120120
Tools/msi/obj
121121
Tools/ssl/amd64
122122
Tools/ssl/win32
123+
Tools/freeze/test/outdir
123124

124125
# The frozen modules are always generated by the build so we don't
125126
# keep them in the repo. Also see Tools/scripts/freeze_modules.py.

Doc/c-api/call.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Object Calling API
185185
Various functions are available for calling a Python object.
186186
Each converts its arguments to a convention supported by the called object –
187187
either *tp_call* or vectorcall.
188-
In order to do as litle conversion as possible, pick one that best fits
188+
In order to do as little conversion as possible, pick one that best fits
189189
the format of data you have available.
190190
191191
The following table summarizes the available functions;

Doc/c-api/gcsupport.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ Constructors for container types must conform to two rules:
3333
#. Once all the fields which may contain references to other containers are
3434
initialized, it must call :c:func:`PyObject_GC_Track`.
3535

36+
Similarly, the deallocator for the object must conform to a similar pair of
37+
rules:
38+
39+
#. Before fields which refer to other containers are invalidated,
40+
:c:func:`PyObject_GC_UnTrack` must be called.
41+
42+
#. The object's memory must be deallocated using :c:func:`PyObject_GC_Del`.
43+
3644
.. warning::
3745
If a type adds the Py_TPFLAGS_HAVE_GC, then it *must* implement at least
3846
a :c:member:`~PyTypeObject.tp_traverse` handler or explicitly use one
@@ -100,14 +108,6 @@ Constructors for container types must conform to two rules:
100108
101109
.. versionadded:: 3.9
102110
103-
Similarly, the deallocator for the object must conform to a similar pair of
104-
rules:
105-
106-
#. Before fields which refer to other containers are invalidated,
107-
:c:func:`PyObject_GC_UnTrack` must be called.
108-
109-
#. The object's memory must be deallocated using :c:func:`PyObject_GC_Del`.
110-
111111
112112
.. c:function:: void PyObject_GC_Del(void *op)
113113

Doc/c-api/init.rst

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ Process-wide parameters
486486
(set by :c:func:`Py_SetProgramName` above) and some environment variables.
487487
The returned string consists of a series of directory names separated by a
488488
platform dependent delimiter character. The delimiter character is ``':'``
489-
on Unix and Mac OS X, ``';'`` on Windows. The returned string points into
489+
on Unix and macOS, ``';'`` on Windows. The returned string points into
490490
static storage; the caller should not modify its value. The list
491491
:data:`sys.path` is initialized with this value on interpreter startup; it
492492
can be (and usually is) modified later to change the search path for loading
@@ -518,7 +518,7 @@ Process-wide parameters
518518
default search path but uses the one provided instead. This is useful if
519519
Python is embedded by an application that has full knowledge of the location
520520
of all modules. The path components should be separated by the platform
521-
dependent delimiter character, which is ``':'`` on Unix and Mac OS X, ``';'``
521+
dependent delimiter character, which is ``':'`` on Unix and macOS, ``';'``
522522
on Windows.
523523
524524
This also causes :data:`sys.executable` to be set to the program
@@ -561,7 +561,7 @@ Process-wide parameters
561561
Return the platform identifier for the current platform. On Unix, this is
562562
formed from the "official" name of the operating system, converted to lower
563563
case, followed by the major revision number; e.g., for Solaris 2.x, which is
564-
also known as SunOS 5.x, the value is ``'sunos5'``. On Mac OS X, it is
564+
also known as SunOS 5.x, the value is ``'sunos5'``. On macOS, it is
565565
``'darwin'``. On Windows, it is ``'win'``. The returned string points into
566566
static storage; the caller should not modify its value. The value is available
567567
to Python code as ``sys.platform``.
@@ -1173,6 +1173,26 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
11731173
.. versionadded:: 3.9
11741174
11751175
1176+
.. c:function:: void PyThreadState_EnterTracing(PyThreadState *tstate)
1177+
1178+
Suspend tracing and profiling in the Python thread state *tstate*.
1179+
1180+
Resume them using the :c:func:`PyThreadState_LeaveTracing` function.
1181+
1182+
.. versionadded:: 3.11
1183+
1184+
1185+
.. c:function:: void PyThreadState_LeaveTracing(PyThreadState *tstate)
1186+
1187+
Resume tracing and profiling in the Python thread state *tstate* suspended
1188+
by the :c:func:`PyThreadState_EnterTracing` function.
1189+
1190+
See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile`
1191+
functions.
1192+
1193+
.. versionadded:: 3.11
1194+
1195+
11761196
.. c:function:: PyInterpreterState* PyInterpreterState_Get(void)
11771197
11781198
Get the current interpreter.
@@ -1623,6 +1643,8 @@ Python-level trace functions in previous versions.
16231643
profile function is called for all monitored events except :const:`PyTrace_LINE`
16241644
:const:`PyTrace_OPCODE` and :const:`PyTrace_EXCEPTION`.
16251645
1646+
See also the :func:`sys.setprofile` function.
1647+
16261648
The caller must hold the :term:`GIL`.
16271649
16281650
@@ -1635,6 +1657,8 @@ Python-level trace functions in previous versions.
16351657
will not receive :const:`PyTrace_C_CALL`, :const:`PyTrace_C_EXCEPTION` or
16361658
:const:`PyTrace_C_RETURN` as a value for the *what* parameter.
16371659
1660+
See also the :func:`sys.settrace` function.
1661+
16381662
The caller must hold the :term:`GIL`.
16391663
16401664

Doc/c-api/init_config.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ There are two kinds of configuration:
2222
* The :ref:`Isolated Configuration <init-isolated-conf>` can be used to embed
2323
Python into an application. It isolates Python from the system. For example,
2424
environments variables are ignored, the LC_CTYPE locale is left unchanged and
25-
no signal handler is registred.
25+
no signal handler is registered.
2626

2727
The :c:func:`Py_RunMain` function can be used to write a customized Python
2828
program.
@@ -706,7 +706,7 @@ PyConfig
706706
* Otherwise, use the :term:`locale encoding`:
707707
``nl_langinfo(CODESET)`` result.
708708
709-
At Python statup, the encoding name is normalized to the Python codec
709+
At Python startup, the encoding name is normalized to the Python codec
710710
name. For example, ``"ANSI_X3.4-1968"`` is replaced with ``"ascii"``.
711711
712712
See also the :c:member:`~PyConfig.filesystem_errors` member.

Doc/c-api/typeobj.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,18 @@ and :c:type:`PyType_Type` effectively act as defaults.)
668668
:c:func:`PyObject_GC_Del` if the instance was allocated using
669669
:c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`.
670670

671+
If the type supports garbage collection (has the :const:`Py_TPFLAGS_HAVE_GC`
672+
flag bit set), the destructor should call :c:func:`PyObject_GC_UnTrack`
673+
before clearing any member fields.
674+
675+
.. code-block:: c
676+
677+
static void foo_dealloc(foo_object *self) {
678+
PyObject_GC_UnTrack(self);
679+
Py_CLEAR(self->ref);
680+
Py_TYPE(self)->tp_free((PyObject *)self);
681+
}
682+
671683
Finally, if the type is heap allocated (:const:`Py_TPFLAGS_HEAPTYPE`), the
672684
deallocator should decrement the reference count for its type object after
673685
calling the type deallocator. In order to avoid dangling pointers, the

0 commit comments

Comments
 (0)