Skip to content

Commit 3e28b76

Browse files
committed
Merge remote-tracking branch 'upstream/main' into no_colorize
2 parents 73a4fb1 + b6c62c7 commit 3e28b76

File tree

513 files changed

+13949
-5091
lines changed

Some content is hidden

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

513 files changed

+13949
-5091
lines changed

.github/workflows/build.yml

+2
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ jobs:
492492
with:
493493
config_hash: ${{ needs.check_source.outputs.config_hash }}
494494
options: ./configure --config-cache --with-thread-sanitizer --with-pydebug
495+
suppressions_path: Tools/tsan/supressions.txt
495496

496497
build_tsan_free_threading:
497498
name: 'Thread sanitizer (free-threading)'
@@ -501,6 +502,7 @@ jobs:
501502
with:
502503
config_hash: ${{ needs.check_source.outputs.config_hash }}
503504
options: ./configure --config-cache --disable-gil --with-thread-sanitizer --with-pydebug
505+
suppressions_path: Tools/tsan/suppressions_free_threading.txt
504506

505507
# CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/
506508
cifuzz:

.github/workflows/reusable-tsan.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
options:
88
required: true
99
type: string
10+
suppressions_path:
11+
description: 'A repo relative path to the suppressions file'
12+
required: true
13+
type: string
1014

1115
jobs:
1216
build_tsan_reusable:
@@ -30,7 +34,7 @@ jobs:
3034
sudo sysctl -w vm.mmap_rnd_bits=28
3135
- name: TSAN Option Setup
3236
run: |
33-
echo "TSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/Tools/tsan/supressions.txt" >> $GITHUB_ENV
37+
echo "TSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/${{ inputs.suppressions_path }}" >> $GITHUB_ENV
3438
echo "CC=clang" >> $GITHUB_ENV
3539
echo "CXX=clang++" >> $GITHUB_ENV
3640
- name: Add ccache to PATH

Doc/c-api/exceptions.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,14 @@ For convenience, some of these functions will always return a
221221
222222
.. c:function:: PyObject* PyErr_SetFromWindowsErr(int ierr)
223223
224-
This is a convenience function to raise :exc:`WindowsError`. If called with
224+
This is a convenience function to raise :exc:`OSError`. If called with
225225
*ierr* of ``0``, the error code returned by a call to :c:func:`!GetLastError`
226226
is used instead. It calls the Win32 function :c:func:`!FormatMessage` to retrieve
227227
the Windows description of error code given by *ierr* or :c:func:`!GetLastError`,
228-
then it constructs a tuple object whose first item is the *ierr* value and whose
229-
second item is the corresponding error message (gotten from
230-
:c:func:`!FormatMessage`), and then calls ``PyErr_SetObject(PyExc_WindowsError,
228+
then it constructs a :exc:`OSError` object with the :attr:`~OSError.winerror`
229+
attribute set to the error code, the :attr:`~OSError.strerror` attribute
230+
set to the corresponding error message (gotten from
231+
:c:func:`!FormatMessage`), and then calls ``PyErr_SetObject(PyExc_OSError,
231232
object)``. This function always returns ``NULL``.
232233
233234
.. availability:: Windows.

Doc/c-api/init.rst

+29-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The following functions can be safely called before Python is initialized:
5959
:c:func:`Py_Initialize`: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`,
6060
:c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`,
6161
:c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`,
62-
and :c:func:`Py_GetProgramName`.
62+
:c:func:`Py_GetProgramName` and :c:func:`PyEval_InitThreads`.
6363

6464

6565
.. _global-conf-vars:
@@ -326,6 +326,7 @@ Initializing and finalizing the interpreter
326326
.. c:function:: void Py_Initialize()
327327
328328
.. index::
329+
single: PyEval_InitThreads()
329330
single: modules (in module sys)
330331
single: path (in module sys)
331332
pair: module; builtins
@@ -841,6 +842,33 @@ code, or when embedding the Python interpreter:
841842
This thread's interpreter state.
842843
843844
845+
.. c:function:: void PyEval_InitThreads()
846+
847+
.. index::
848+
single: PyEval_AcquireThread()
849+
single: PyEval_ReleaseThread()
850+
single: PyEval_SaveThread()
851+
single: PyEval_RestoreThread()
852+
853+
Deprecated function which does nothing.
854+
855+
In Python 3.6 and older, this function created the GIL if it didn't exist.
856+
857+
.. versionchanged:: 3.9
858+
The function now does nothing.
859+
860+
.. versionchanged:: 3.7
861+
This function is now called by :c:func:`Py_Initialize()`, so you don't
862+
have to call it yourself anymore.
863+
864+
.. versionchanged:: 3.2
865+
This function cannot be called before :c:func:`Py_Initialize()` anymore.
866+
867+
.. deprecated:: 3.9
868+
869+
.. index:: pair: module; _thread
870+
871+
844872
.. c:function:: PyThreadState* PyEval_SaveThread()
845873
846874
Release the global interpreter lock (if it has been created) and reset the

Doc/c-api/unicode.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ APIs:
523523
- Get the fully qualified name of an object type;
524524
call :c:func:`PyType_GetFullyQualifiedName`.
525525
526-
* - ``T#``
526+
* - ``#T``
527527
- :c:expr:`PyObject*`
528528
- Similar to ``T`` format, but use a colon (``:``) as separator between
529529
the module name and the qualified name.
@@ -533,7 +533,7 @@ APIs:
533533
- Get the fully qualified name of a type;
534534
call :c:func:`PyType_GetFullyQualifiedName`.
535535
536-
* - ``N#``
536+
* - ``#N``
537537
- :c:expr:`PyTypeObject*`
538538
- Similar to ``N`` format, but use a colon (``:``) as separator between
539539
the module name and the qualified name.
@@ -574,7 +574,7 @@ APIs:
574574
copied as-is to the result string, and any extra arguments discarded.
575575
576576
.. versionchanged:: 3.13
577-
Support for ``%T``, ``%T#``, ``%N`` and ``%N#`` formats added.
577+
Support for ``%T``, ``%#T``, ``%N`` and ``%#N`` formats added.
578578
579579
580580
.. c:function:: PyObject* PyUnicode_FromFormatV(const char *format, va_list vargs)

Doc/conf.py

+16
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
sys.path.append(os.path.abspath('tools/extensions'))
1313
sys.path.append(os.path.abspath('includes'))
1414

15+
from pyspecific import SOURCE_URI
16+
1517
# General configuration
1618
# ---------------------
1719

@@ -24,6 +26,7 @@
2426
'pyspecific',
2527
'sphinx.ext.coverage',
2628
'sphinx.ext.doctest',
29+
'sphinx.ext.extlinks',
2730
]
2831

2932
# Skip if downstream redistributors haven't installed them
@@ -513,6 +516,19 @@
513516
r'https://unix.org/version2/whatsnew/lp64_wp.html',
514517
]
515518

519+
# Options for sphinx.ext.extlinks
520+
# -------------------------------
521+
522+
# This config is a dictionary of external sites,
523+
# mapping unique short aliases to a base URL and a prefix.
524+
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
525+
extlinks = {
526+
"cve": ("https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-%s", "CVE-%s"),
527+
"cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"),
528+
"pypi": ("https://pypi.org/project/%s/", "%s"),
529+
"source": (SOURCE_URI, "%s"),
530+
}
531+
extlinks_detect_hardcoded_links = True
516532

517533
# Options for extensions
518534
# ----------------------

Doc/data/stable_abi.dat

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Doc/faq/library.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -616,16 +616,15 @@ use ``p.read(n)``.
616616
("ptys") instead of pipes. Or you can use a Python interface to Don Libes'
617617
"expect" library. A Python extension that interfaces to expect is called
618618
"expy" and available from https://expectpy.sourceforge.net. A pure Python
619-
solution that works like expect is `pexpect
620-
<https://pypi.org/project/pexpect/>`_.
619+
solution that works like expect is :pypi:`pexpect`.
621620
622621
623622
How do I access the serial (RS232) port?
624623
----------------------------------------
625624
626625
For Win32, OSX, Linux, BSD, Jython, IronPython:
627626
628-
https://pypi.org/project/pyserial/
627+
:pypi:`pyserial`
629628
630629
For Unix, see a Usenet post by Mitch Chapman:
631630

Doc/glossary.rst

+7-8
Original file line numberDiff line numberDiff line change
@@ -547,12 +547,12 @@ Glossary
547547
tasks such as compression or hashing. Also, the GIL is always released
548548
when doing I/O.
549549

550-
Past efforts to create a "free-threaded" interpreter (one which locks
551-
shared data at a much finer granularity) have not been successful
552-
because performance suffered in the common single-processor case. It
553-
is believed that overcoming this performance issue would make the
554-
implementation much more complicated and therefore costlier to maintain.
555-
550+
As of Python 3.13, the GIL can be disabled using the :option:`--disable-gil`
551+
build configuration. After building Python with this option, code must be
552+
run with :option:`-X gil 0 <-X>` or after setting the :envvar:`PYTHON_GIL=0 <PYTHON_GIL>`
553+
environment variable. This feature enables improved performance for
554+
multi-threaded applications and makes it easier to use multi-core CPUs
555+
efficiently. For more details, see :pep:`703`.
556556

557557
hash-based pyc
558558
A bytecode cache file that uses the hash rather than the last-modified
@@ -800,8 +800,7 @@ Glossary
800800

801801
method resolution order
802802
Method Resolution Order is the order in which base classes are searched
803-
for a member during lookup. See `The Python 2.3 Method Resolution Order
804-
<https://www.python.org/download/releases/2.3/mro/>`_ for details of the
803+
for a member during lookup. See :ref:`python_2.3_mro` for details of the
805804
algorithm used by the Python interpreter since the 2.3 release.
806805

807806
module

Doc/howto/curses.rst

+3-5
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ appearance---and the curses library will figure out what control codes
4343
need to be sent to the terminal to produce the right output. curses
4444
doesn't provide many user-interface concepts such as buttons, checkboxes,
4545
or dialogs; if you need such features, consider a user interface library such as
46-
`Urwid <https://pypi.org/project/urwid/>`_.
46+
:pypi:`Urwid`.
4747

4848
The curses library was originally written for BSD Unix; the later System V
4949
versions of Unix from AT&T added many enhancements and new functions. BSD curses
@@ -56,8 +56,7 @@ versions of curses carried by some proprietary Unixes may not support
5656
everything, though.
5757

5858
The Windows version of Python doesn't include the :mod:`curses`
59-
module. A ported version called `UniCurses
60-
<https://pypi.org/project/UniCurses>`_ is available.
59+
module. A ported version called :pypi:`UniCurses` is available.
6160

6261

6362
The Python curses module
@@ -429,8 +428,7 @@ User Input
429428

430429
The C curses library offers only very simple input mechanisms. Python's
431430
:mod:`curses` module adds a basic text-input widget. (Other libraries
432-
such as `Urwid <https://pypi.org/project/urwid/>`_ have more extensive
433-
collections of widgets.)
431+
such as :pypi:`Urwid` have more extensive collections of widgets.)
434432

435433
There are two methods for getting input from a window:
436434

Doc/howto/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ Currently, the HOWTOs are:
3333
annotations.rst
3434
isolating-extensions.rst
3535
timerfd.rst
36+
mro.rst
3637

Doc/howto/logging-cookbook.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -1912,7 +1912,7 @@ Subclassing QueueHandler and QueueListener- a ``pynng`` example
19121912
---------------------------------------------------------------
19131913

19141914
In a similar way to the above section, we can implement a listener and handler
1915-
using `pynng <https://pypi.org/project/pynng/>`_, which is a Python binding to
1915+
using :pypi:`pynng`, which is a Python binding to
19161916
`NNG <https://nng.nanomsg.org/>`_, billed as a spiritual successor to ZeroMQ.
19171917
The following snippets illustrate -- you can test them in an environment which has
19181918
``pynng`` installed. Just for variety, we present the listener first.
@@ -3575,9 +3575,8 @@ A Qt GUI for logging
35753575

35763576
A question that comes up from time to time is about how to log to a GUI
35773577
application. The `Qt <https://www.qt.io/>`_ framework is a popular
3578-
cross-platform UI framework with Python bindings using `PySide2
3579-
<https://pypi.org/project/PySide2/>`_ or `PyQt5
3580-
<https://pypi.org/project/PyQt5/>`_ libraries.
3578+
cross-platform UI framework with Python bindings using :pypi:`PySide2`
3579+
or :pypi:`PyQt5` libraries.
35813580

35823581
The following example shows how to log to a Qt GUI. This introduces a simple
35833582
``QtHandler`` class which takes a callable, which should be a slot in the main

0 commit comments

Comments
 (0)