Skip to content

Commit 08dd92f

Browse files
authored
Merge branch 'main' into scanfix-tzpath-izmaolcq
2 parents 4ff128c + fd8f475 commit 08dd92f

327 files changed

Lines changed: 8416 additions & 1578 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/VULNERABILITY_REPORT.yml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ body:
5151
- "3.15"
5252
- "3.16"
5353
- "CPython main branch"
54-
validations:
55-
required: true
5654
- type: textarea
5755
id: patch
5856
attributes:

‎.github/workflows/reusable-emscripten.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,5 @@ jobs:
7979
run: python3 Platforms/emscripten run --test
8080
- name: "Test Repl"
8181
run: Platforms/emscripten/browser_test/run_test.sh
82+
- name: "Test embedding"
83+
run: Platforms/emscripten/web_embed_test/run_test.sh

‎.github/workflows/reusable-wasi.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ jobs:
1616
timeout-minutes: 60
1717
env:
1818
WASMTIME_VERSION: 48.0.2
19-
CROSS_BUILD_WASI: cross-build/wasm32-wasip1
2019
steps:
2120
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2221
with:
@@ -65,4 +64,6 @@ jobs:
6564
- name: "Display build info of the host/WASI Python"
6665
run: python3 Platforms/WASI pythoninfo-host
6766
- name: "Test"
68-
run: make --directory "${CROSS_BUILD_WASI}" test
67+
run: |
68+
CROSS_BUILD_WASI=$(python3 Platforms/WASI path)
69+
make --directory "${CROSS_BUILD_WASI}" test

‎.gitignore‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,19 @@ Lib/test/data/*
7272
/_bootstrap_python
7373
/Makefile
7474
/Makefile.pre
75-
/iOSTestbed.*
76-
Apple/iOS/Frameworks/
77-
Apple/iOS/Resources/Info.plist
78-
Apple/testbed/build
75+
/AppleTestbed.*
76+
Platforms/Apple/iOS/Frameworks/*
77+
Platforms/Apple/iOS/Resources/Info.plist
7978
Platforms/Apple/testbed/Python*.xcframework/*/bin
8079
Platforms/Apple/testbed/Python*.xcframework/*/include
8180
Platforms/Apple/testbed/Python*.xcframework/*/lib
8281
Platforms/Apple/testbed/Python*.xcframework/*/Python*.framework
83-
Apple/testbed/*Testbed.xcodeproj/project.xcworkspace
84-
Apple/testbed/*Testbed.xcodeproj/xcuserdata
82+
Platforms/Apple/tvOS/Frameworks/*
83+
Platforms/Apple/tvOS/Resources/Info.plist
84+
Platforms/Apple/visionOS/Frameworks/*
85+
Platforms/Apple/visionOS/Resources/Info.plist
86+
Platforms/Apple/watchOS/Frameworks/*
87+
Platforms/Apple/watchOS/Resources/Info.plist
8588
Mac/Makefile
8689
Mac/PythonLauncher/Info.plist
8790
Mac/PythonLauncher/Makefile

‎Doc/README.rst‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ tree but are maintained separately and are available from
2121
* `Sphinx <https://pypi.org/project/Sphinx/>`_
2222
* `blurb <https://pypi.org/project/blurb/>`_
2323
* `python-docs-theme <https://pypi.org/project/python-docs-theme/>`_
24+
* `sphinx-linklint <https://pypi.org/project/sphinx-linklint/>`_
2425

2526
The easiest way to install these tools is to create a virtual environment and
2627
install the tools into there.
@@ -57,6 +58,8 @@ Available make targets are:
5758
* "venv", which creates a virtual environment with all necessary tools
5859
installed.
5960

61+
* "lock", which regenerates the pinned dependencies in ``pylock.toml``.
62+
6063
* "html", which builds standalone HTML files for offline viewing.
6164

6265
* "htmlview", which re-uses the "html" builder, but then opens the main page
@@ -79,6 +82,9 @@ Available make targets are:
7982

8083
* "text", which builds a plain text file for each source file.
8184

85+
* "texinfo", which builds Texinfo source files as input to ``makeinfo`` to
86+
produce Info documents.
87+
8288
* "epub", which builds an EPUB document, suitable to be viewed on e-book
8389
readers.
8490

@@ -97,6 +103,10 @@ Available make targets are:
97103
plain text documentation for the labels defined in
98104
``tools/pyspecific.py`` -- pydoc needs these to show topic and keyword help.
99105

106+
* "doctest", which runs doctests in the documentation.
107+
108+
* "gettext", which generates gettext message catalog templates.
109+
100110
* "check", which checks for frequent markup errors.
101111

102112
* "dist", (Unix only) which creates distributable archives of HTML, text,

‎Doc/conf.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@
8686
.. |python_x_dot_y_literal| replace:: ``python{version}``
8787
.. |python_x_dot_y_t_literal| replace:: ``python{version}t``
8888
.. |python_x_dot_y_t_literal_config| replace:: ``python{version}t-config``
89+
.. |python_x_dot_y_exe_literal| replace:: ``python{version}.exe``
90+
.. |python_x_dot_y_t_exe_literal| replace:: ``python{version}t.exe``
91+
.. |python_xy_dll_literal| replace:: ``python{v.major}{v.minor}.dll``
92+
.. |py_v_x_dot_y_literal| replace:: ``py -V:{version}``
93+
.. |py_v_x_dot_y_t_literal| replace:: ``py -V:{version}t``
94+
.. |x_dot_y_literal| replace:: ``{version}``
95+
.. |x_dot_y_64_literal| replace:: ``{version}-64``
8996
.. |x_dot_y_b2_literal| replace:: ``{version}.0b2``
9097
.. |applications_python_version_literal| replace:: ``/Applications/Python {version}/``
9198
.. |usr_local_bin_python_x_dot_y_literal| replace:: ``/usr/local/bin/python{version}``

‎Doc/library/argparse.rst‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,9 @@ how the command-line arguments should be handled. The supplied actions are:
789789
>>> parser.parse_args('--foo --bar'.split())
790790
Namespace(foo=True, bar=False, baz=True)
791791

792+
These defaults apply when the options are absent. They can be overridden
793+
by default_ or argument_default_.
794+
792795
* ``'append'`` - This appends each argument value to a list.
793796
It is useful for allowing an option to be specified multiple times.
794797
If the default value is a non-empty list, the parsed value for the option
@@ -1016,10 +1019,8 @@ default
10161019

10171020
All optional arguments and some positional arguments may be omitted at the
10181021
command line. The ``default`` keyword argument of
1019-
:meth:`~ArgumentParser.add_argument`, whose value defaults to ``None``,
1020-
specifies what value should be used if the command-line argument is not present.
1021-
For optional arguments, the ``default`` value is used when the option string
1022-
was not present at the command line::
1022+
:meth:`~ArgumentParser.add_argument` specifies what value should be used if the
1023+
command-line argument is not present. For example::
10231024

10241025
>>> parser = argparse.ArgumentParser()
10251026
>>> parser.add_argument('--foo', default=42)
@@ -1028,6 +1029,11 @@ was not present at the command line::
10281029
>>> parser.parse_args([])
10291030
Namespace(foo=42)
10301031

1032+
If ``default`` is omitted, :meth:`~ArgumentParser.add_argument` uses a value
1033+
previously set for the dest_ with :meth:`~ArgumentParser.set_defaults`, or
1034+
otherwise a non-``None`` argument_default_. If neither is set, the action's
1035+
own default is used.
1036+
10311037
If the target namespace already has an attribute set, the action *default*
10321038
will not overwrite it::
10331039

‎Doc/library/cmd.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ command interpreters. These are often useful for test harnesses, administrative
1313
tools, and prototypes that will later be wrapped in a more sophisticated
1414
interface.
1515

16+
A command interpreter built with :class:`Cmd` typically presents the user
17+
with an interactive prompt, reads input one line at a time, and dispatches each
18+
command to a method named ``do_`` followed by the command name. For example,
19+
the ``help`` command is handled by the :meth:`~Cmd.do_help` method. Apart from
20+
the built-in ``help`` command, most of the interpreter's behavior is defined by
21+
the ``do_*`` methods you add in your own subclass.
22+
1623
.. class:: Cmd(completekey='tab', stdin=None, stdout=None)
1724

1825
A :class:`Cmd` instance or subclass instance is a line-oriented interpreter

‎Doc/library/ctypes.rst‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,31 @@ write::
13371337
:class:`threading.local` will *not* survive across different callbacks, even when
13381338
those calls are made from the same C thread.
13391339

1340+
Callback functions can return structures and unions by value, in addition to
1341+
the simple types:
1342+
1343+
.. code-block:: python
1344+
1345+
class Point(Structure):
1346+
_fields_ = [("x", c_int), ("y", c_int)]
1347+
1348+
@CFUNCTYPE(Point)
1349+
def get_origin():
1350+
return Point(0, 0)
1351+
1352+
.. note::
1353+
1354+
A structure or union returned from a callback is copied *by value*, and
1355+
:mod:`!ctypes` does not keep the returned object alive after the callback
1356+
returns. If the structure contains a pointer field (such as
1357+
:class:`c_char_p` or a :func:`POINTER` type), you must ensure that the
1358+
memory it refers to stays valid for as long as the C code uses it -- the
1359+
same requirement C itself imposes. Returning a pointer to memory owned by
1360+
a temporary Python object will leave the C caller with a dangling pointer.
1361+
1362+
.. versionchanged:: next
1363+
Callback functions can now return structures and unions.
1364+
13401365
.. _ctypes-accessing-values-exported-from-dlls:
13411366

13421367
Accessing values exported from dlls

‎Doc/library/curses.rst‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,11 @@ Input options
274274

275275
Used for half-delay mode, which is similar to cbreak mode in that characters
276276
typed by the user are immediately available to the program. However, after
277-
blocking for *tenths* tenths of seconds, raise an exception if nothing has
278-
been typed. The value of *tenths* must be a number between ``1`` and ``255``. Use
279-
:func:`nocbreak` to leave half-delay mode.
277+
blocking for *tenths* tenths of seconds, if nothing has been typed,
278+
:meth:`~window.getch` returns ``-1``, while :meth:`~window.getkey` and
279+
:meth:`~window.get_wch` raise :exc:`curses.error`.
280+
The value of *tenths* must be a number between ``1`` and ``255``.
281+
Use :func:`nocbreak` to leave half-delay mode.
280282

281283
.. function:: meta(flag)
282284

@@ -893,8 +895,10 @@ Querying the terminal
893895

894896
.. function:: termname()
895897

896-
Return the value of the environment variable :envvar:`TERM`, as a bytes object,
897-
truncated to 14 characters.
898+
Return the name of the terminal in use, as a bytes object.
899+
This is the name passed to :func:`newterm` or
900+
:func:`setupterm`, or the value of the :envvar:`TERM` environment variable
901+
if none was given. Some curses libraries truncate it to 14 characters.
898902

899903
.. function:: longname()
900904

@@ -1227,7 +1231,8 @@ Adding and inserting text
12271231
Insert character *ch* with attributes *attr* before the character under the
12281232
cursor, or at ``(y, x)`` if specified. All characters to the right of the
12291233
cursor are shifted one position right, with the rightmost character on the
1230-
line being lost. The cursor position does not change.
1234+
line being lost.
1235+
The cursor position does not change (after moving to *y*, *x*, if specified).
12311236

12321237
.. versionchanged:: 3.16
12331238
Wide and combining characters, and :class:`complexchar` cells, are now
@@ -1251,8 +1256,8 @@ Adding and inserting text
12511256
window.insnstr(y, x, str, n[, attr])
12521257

12531258
Insert a character string (as many characters as will fit on the line) before
1254-
the character under the cursor, up to *n* characters. If *n* is zero or
1255-
negative, the entire string is inserted. All characters to the right of the
1259+
the character under the cursor, up to *n* characters. If *n* is negative,
1260+
the entire string is inserted. All characters to the right of the
12561261
cursor are shifted right, with the rightmost characters on the line being lost.
12571262
The cursor position does not change (after moving to *y*, *x*, if specified).
12581263

@@ -1871,8 +1876,9 @@ Output options
18711876
.. method:: window.scroll([lines=1])
18721877

18731878
Scroll the screen or scrolling region. Scroll upward by *lines* lines if
1874-
*lines* is positive, or downward if it is negative. Scrolling has no effect
1875-
unless it has been enabled for the window with :meth:`scrollok`.
1879+
*lines* is positive, or downward if it is negative.
1880+
Raise :exc:`curses.error` unless scrolling has been enabled for the window
1881+
with :meth:`scrollok`.
18761882

18771883
.. method:: window.setscrreg(top, bottom)
18781884

0 commit comments

Comments
 (0)