Skip to content

Commit bb38e0e

Browse files
authored
Merge branch 'main' into guard-blake2
2 parents 9c1bbbf + 2e9be80 commit bb38e0e

File tree

128 files changed

+2170
-503
lines changed

Some content is hidden

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

128 files changed

+2170
-503
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,7 @@ jobs:
514514
strategy:
515515
fail-fast: false
516516
matrix:
517-
# sanitizer: [address, undefined, memory] -- memory skipped temporarily until GH-116886 is solved.
518-
sanitizer: [address, undefined]
517+
sanitizer: [address, undefined, memory]
519518
steps:
520519
- name: Build fuzzers (${{ matrix.sanitizer }})
521520
id: build

.github/workflows/jit.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ on:
55
- '**jit**'
66
- 'Python/bytecodes.c'
77
- 'Python/optimizer*.c'
8-
- 'Python/optimizer_bytecodes.c'
98
push:
109
paths:
1110
- '**jit**'
1211
- 'Python/bytecodes.c'
1312
- 'Python/optimizer*.c'
14-
- 'Python/optimizer_bytecodes.c'
1513
workflow_dispatch:
1614

1715
concurrency:
@@ -22,7 +20,7 @@ jobs:
2220
jit:
2321
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }})
2422
runs-on: ${{ matrix.runner }}
25-
timeout-minutes: 60
23+
timeout-minutes: 75
2624
strategy:
2725
fail-fast: false
2826
matrix:
@@ -95,7 +93,7 @@ jobs:
9593
run: |
9694
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
9795
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '--pgo' }} -p ${{ matrix.architecture }}
98-
./PCbuild/rt.bat ${{ matrix.debug && '-d' }} -p ${{ matrix.architecture }} -q --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
96+
./PCbuild/rt.bat ${{ matrix.debug && '-d' }} -p ${{ matrix.architecture }} -q --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 4500 --verbose2 --verbose3
9997
10098
# No PGO or tests (yet):
10199
- name: Emulated Windows
@@ -111,7 +109,7 @@ jobs:
111109
SDKROOT="$(xcrun --show-sdk-path)" \
112110
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
113111
make all --jobs 4
114-
./python.exe -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
112+
./python.exe -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 4500 --verbose2 --verbose3
115113
116114
- name: Native Linux
117115
if: runner.os == 'Linux' && matrix.architecture == 'x86_64'
@@ -120,7 +118,7 @@ jobs:
120118
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
121119
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
122120
make all --jobs 4
123-
./python -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
121+
./python -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 4500 --verbose2 --verbose3
124122
125123
- name: Emulated Linux
126124
if: runner.os == 'Linux' && matrix.architecture != 'x86_64'
@@ -140,4 +138,4 @@ jobs:
140138
HOSTRUNNER=qemu-${{ matrix.architecture }} \
141139
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }} --build=x86_64-linux-gnu --host="$HOST" --with-build-python=../build/bin/python3 --with-pkg-config=no ac_cv_buggy_getaddrinfo=no ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes
142140
make all --jobs 4
143-
./python -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
141+
./python -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 4500 --verbose2 --verbose3

.pre-commit-config.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.2.0
3+
rev: v0.3.4
44
hooks:
55
- id: ruff
66
name: Run Ruff on Lib/test/
@@ -14,6 +14,8 @@ repos:
1414
- repo: https://github.com/pre-commit/pre-commit-hooks
1515
rev: v4.5.0
1616
hooks:
17+
- id: check-case-conflict
18+
- id: check-merge-conflict
1719
- id: check-toml
1820
exclude: ^Lib/test/test_tomllib/
1921
- id: check-yaml

Doc/includes/wasm-ios-notavail.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.. include for modules that don't work on WASM or iOS
2+
3+
.. availability:: not WASI, not iOS.
4+
5+
This module does not work or is not available on WebAssembly platforms, or
6+
on iOS. See :ref:`wasm-availability` for more information on WASM
7+
availability; see :ref:`iOS-availability` for more information on iOS
8+
availability.

Doc/includes/wasm-notavail.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.. include for modules that don't work on WASM
22
3-
.. availability:: not Emscripten, not WASI.
3+
.. availability:: not WASI.
44

5-
This module does not work or is not available on WebAssembly platforms
6-
``wasm32-emscripten`` and ``wasm32-wasi``. See
5+
This module does not work or is not available on WebAssembly. See
76
:ref:`wasm-availability` for more information.

Doc/library/curses.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ for Windows, DOS, and possibly other systems as well. This extension module is
2121
designed to match the API of ncurses, an open-source curses library hosted on
2222
Linux and the BSD variants of Unix.
2323

24+
.. include:: ../includes/wasm-ios-notavail.rst
25+
2426
.. note::
2527

2628
Whenever the documentation mentions a *character* it can be specified

Doc/library/dbm.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ slow-but-simple implementation in module :mod:`dbm.dumb` will be used. There
1919
is a `third party interface <https://www.jcea.es/programacion/pybsddb.htm>`_ to
2020
the Oracle Berkeley DB.
2121

22+
.. include:: ../includes/wasm-ios-notavail.rst
2223

2324
.. exception:: error
2425

@@ -455,4 +456,3 @@ The :mod:`!dbm.dumb` module defines the following:
455456
.. method:: dumbdbm.close()
456457

457458
Close the database.
458-

Doc/library/dis.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ iterations of the loop.
12241224
except that ``namei`` is shifted left by 2 bits instead of 1.
12251225

12261226
The low bit of ``namei`` signals to attempt a method load, as with
1227-
:opcode:`LOAD_ATTR`, which results in pushing ``None`` and the loaded method.
1227+
:opcode:`LOAD_ATTR`, which results in pushing ``NULL`` and the loaded method.
12281228
When it is unset a single value is pushed to the stack.
12291229

12301230
The second-low bit of ``namei``, if set, means that this was a two-argument

Doc/library/doctest.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ And so on, eventually ending with:
123123
OverflowError: n too large
124124
ok
125125
2 items passed all tests:
126-
1 tests in __main__
127-
8 tests in __main__.factorial
128-
9 tests in 2 items.
129-
9 passed and 0 failed.
126+
1 test in __main__
127+
6 tests in __main__.factorial
128+
7 tests in 2 items.
129+
7 passed.
130130
Test passed.
131131
$
132132
@@ -1021,7 +1021,8 @@ from text files and modules with doctests:
10211021
and runs the interactive examples in each file. If an example in any file
10221022
fails, then the synthesized unit test fails, and a :exc:`failureException`
10231023
exception is raised showing the name of the file containing the test and a
1024-
(sometimes approximate) line number.
1024+
(sometimes approximate) line number. If all the examples in a file are
1025+
skipped, then the synthesized unit test is also marked as skipped.
10251026

10261027
Pass one or more paths (as strings) to text files to be examined.
10271028

@@ -1087,7 +1088,8 @@ from text files and modules with doctests:
10871088
and runs each doctest in the module. If any of the doctests fail, then the
10881089
synthesized unit test fails, and a :exc:`failureException` exception is raised
10891090
showing the name of the file containing the test and a (sometimes approximate)
1090-
line number.
1091+
line number. If all the examples in a docstring are skipped, then the
1092+
synthesized unit test is also marked as skipped.
10911093

10921094
Optional argument *module* provides the module to be tested. It can be a module
10931095
object or a (possibly dotted) module name. If not specified, the module calling
@@ -1933,7 +1935,7 @@ such a test runner::
19331935
optionflags=flags)
19341936
else:
19351937
fail, total = doctest.testmod(optionflags=flags)
1936-
print("{} failures out of {} tests".format(fail, total))
1938+
print(f"{fail} failures out of {total} tests")
19371939

19381940

19391941
.. rubric:: Footnotes

Doc/library/ensurepip.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ when creating a virtual environment) or after explicitly uninstalling
3838
:pep:`453`: Explicit bootstrapping of pip in Python installations
3939
The original rationale and specification for this module.
4040

41-
.. include:: ../includes/wasm-notavail.rst
41+
.. include:: ../includes/wasm-ios-notavail.rst
4242

4343
Command line interface
4444
----------------------

Doc/library/fcntl.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines.
1818
See the :manpage:`fcntl(2)` and :manpage:`ioctl(2)` Unix manual pages
1919
for full details.
2020

21-
.. availability:: Unix, not Emscripten, not WASI.
21+
.. availability:: Unix, not WASI.
2222

2323
All functions in this module take a file descriptor *fd* as their first
2424
argument. This can be an integer file descriptor, such as returned by

Doc/library/grp.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
This module provides access to the Unix group database. It is available on all
1111
Unix versions.
1212

13-
.. availability:: Unix, not Emscripten, not WASI.
13+
.. availability:: Unix, not WASI, not iOS.
1414

1515
Group database entries are reported as a tuple-like object, whose attributes
1616
correspond to the members of the ``group`` structure (Attribute field below, see

Doc/library/gzip.rst

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,12 @@ The module defines the following items:
100100
compression, and ``9`` is slowest and produces the most compression. ``0``
101101
is no compression. The default is ``9``.
102102

103-
The *mtime* argument is an optional numeric timestamp to be written to
104-
the last modification time field in the stream when compressing. It
105-
should only be provided in compression mode. If omitted or ``None``, the
106-
current time is used. See the :attr:`mtime` attribute for more details.
103+
The optional *mtime* argument is the timestamp requested by gzip. The time
104+
is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970.
105+
If *mtime* is omitted or None, the current time is used. Use *mtime* = 0
106+
to generate a compressed stream that does not depend on creation time.
107+
108+
See below for the :attr:`mtime` attribute that is set when decompressing.
107109

108110
Calling a :class:`GzipFile` object's :meth:`!close` method does not close
109111
*fileobj*, since you might wish to append more material after the compressed
@@ -133,15 +135,10 @@ The module defines the following items:
133135

134136
.. attribute:: mtime
135137

136-
When decompressing, the value of the last modification time field in
137-
the most recently read header may be read from this attribute, as an
138-
integer. The initial value before reading any headers is ``None``.
139-
140-
All :program:`gzip` compressed streams are required to contain this
141-
timestamp field. Some programs, such as :program:`gunzip`\ , make use
142-
of the timestamp. The format is the same as the return value of
143-
:func:`time.time` and the :attr:`~os.stat_result.st_mtime` attribute of
144-
the object returned by :func:`os.stat`.
138+
When decompressing, this attribute is set to the last timestamp in the most
139+
recently read header. It is an integer, holding the number of seconds
140+
since the Unix epoch (00:00:00 UTC, January 1, 1970).
141+
The initial value before reading any headers is ``None``.
145142

146143
.. attribute:: name
147144

Doc/library/intro.rst

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Notes on availability
5858
operating system.
5959

6060
* If not separately noted, all functions that claim "Availability: Unix" are
61-
supported on macOS, which builds on a Unix core.
61+
supported on macOS and iOS, both of which build on a Unix core.
6262

6363
* If an availability note contains both a minimum Kernel version and a minimum
6464
libc version, then both conditions must hold. For example a feature with note
@@ -119,3 +119,44 @@ DOM APIs as well as limited networking capabilities with JavaScript's
119119
.. _wasmtime: https://wasmtime.dev/
120120
.. _Pyodide: https://pyodide.org/
121121
.. _PyScript: https://pyscript.net/
122+
123+
.. _iOS-availability:
124+
125+
iOS
126+
---
127+
128+
iOS is, in most respects, a POSIX operating system. File I/O, socket handling,
129+
and threading all behave as they would on any POSIX operating system. However,
130+
there are several major differences between iOS and other POSIX systems.
131+
132+
* iOS can only use Python in "embedded" mode. There is no Python REPL, and no
133+
ability to execute binaries that are part of the normal Python developer
134+
experience, such as :program:`pip`. To add Python code to your iOS app, you must use
135+
the :ref:`Python embedding API <embedding>` to add a Python interpreter to an
136+
iOS app created with Xcode. See the :ref:`iOS usage guide <using-ios>` for
137+
more details.
138+
139+
* An iOS app cannot use any form of subprocessing, background processing, or
140+
inter-process communication. If an iOS app attempts to create a subprocess,
141+
the process creating the subprocess will either lock up, or crash. An iOS app
142+
has no visibility of other applications that are running, nor any ability to
143+
communicate with other running applications, outside of the iOS-specific APIs
144+
that exist for this purpose.
145+
146+
* iOS apps have limited access to modify system resources (such as the system
147+
clock). These resources will often be *readable*, but attempts to modify
148+
those resources will usually fail.
149+
150+
* iOS apps have a limited concept of console input and output. ``stdout`` and
151+
``stderr`` *exist*, and content written to ``stdout`` and ``stderr`` will be
152+
visible in logs when running in Xcode, but this content *won't* be recorded
153+
in the system log. If a user who has installed your app provides their app
154+
logs as a diagnostic aid, they will not include any detail written to
155+
``stdout`` or ``stderr``.
156+
157+
iOS apps have no concept of ``stdin`` at all. While iOS apps can have a
158+
keyboard, this is a software feature, not something that is attached to
159+
``stdin``.
160+
161+
As a result, Python library that involve console manipulation (such as
162+
:mod:`curses` and :mod:`readline`) are not available on iOS.

Doc/library/multiprocessing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
--------------
1010

11-
.. include:: ../includes/wasm-notavail.rst
11+
.. include:: ../includes/wasm-ios-notavail.rst
1212

1313
Introduction
1414
------------

0 commit comments

Comments
 (0)