Skip to content

Commit cb60e92

Browse files
Merge branch 'main' into urllib-parse-allow-none
2 parents 2d98e4c + fb690c3 commit cb60e92

Some content is hidden

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

45 files changed

+3681
-1734
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ Tools/wasm/config.site-wasm32-emscripten @freakboy3742 @emmatyping
176176
Tools/wasm/emscripten @freakboy3742 @emmatyping
177177

178178
# WebAssembly (WASI)
179+
Platforms/WASI @brettcannon @emmatyping @savannahostrowski
179180
Tools/wasm/wasi-env @brettcannon @emmatyping @savannahostrowski
180181
Tools/wasm/wasi.py @brettcannon @emmatyping @savannahostrowski
181182
Tools/wasm/wasi @brettcannon @emmatyping @savannahostrowski

.github/workflows/reusable-wasi.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ jobs:
4747
- name: "Runner image version"
4848
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
4949
- name: "Configure build Python"
50-
run: python3 Tools/wasm/wasi configure-build-python -- --config-cache --with-pydebug
50+
run: python3 Platforms/WASI configure-build-python -- --config-cache --with-pydebug
5151
- name: "Make build Python"
52-
run: python3 Tools/wasm/wasi make-build-python
52+
run: python3 Platforms/WASI make-build-python
5353
- name: "Configure host"
5454
# `--with-pydebug` inferred from configure-build-python
55-
run: python3 Tools/wasm/wasi configure-host -- --config-cache
55+
run: python3 Platforms/WASI configure-host -- --config-cache
5656
- name: "Make host"
57-
run: python3 Tools/wasm/wasi make-host
57+
run: python3 Platforms/WASI make-host
5858
- name: "Display build info"
5959
run: make --directory "${CROSS_BUILD_WASI}" pythoninfo
6060
- name: "Test"

Doc/c-api/conversion.rst

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ The following functions provide locale-independent string to number conversions.
130130
131131
*flags* can be zero or more of the following values or-ed together:
132132
133+
.. c:namespace:: NULL
134+
133135
.. c:macro:: Py_DTSF_SIGN
134136
135137
Always precede the returned string with a sign
@@ -151,9 +153,21 @@ The following functions provide locale-independent string to number conversions.
151153
152154
.. versionadded:: 3.11
153155
154-
If *ptype* is non-``NULL``, then the value it points to will be set to one of
155-
``Py_DTST_FINITE``, ``Py_DTST_INFINITE``, or ``Py_DTST_NAN``, signifying that
156-
*val* is a finite number, an infinite number, or not a number, respectively.
156+
If *ptype* is non-``NULL``, then the value it points to will be set to one
157+
of the following constants depending on the type of *val*:
158+
159+
.. list-table::
160+
:header-rows: 1
161+
:align: left
162+
163+
* - *\*ptype*
164+
- type of *val*
165+
* - .. c:macro:: Py_DTST_FINITE
166+
- finite number
167+
* - .. c:macro:: Py_DTST_INFINITE
168+
- infinite number
169+
* - .. c:macro:: Py_DTST_NAN
170+
- not a number
157171
158172
The return value is a pointer to *buffer* with the converted string or
159173
``NULL`` if the conversion failed. The caller is responsible for freeing the

Doc/c-api/long.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ Export API
687687
688688
.. versionadded:: 3.14
689689
690-
.. c:struct:: PyLongLayout
690+
.. c:type:: PyLongLayout
691691
692692
Layout of an array of "digits" ("limbs" in the GMP terminology), used to
693693
represent absolute value for arbitrary precision integers.
@@ -727,15 +727,15 @@ Export API
727727
728728
Get the native layout of Python :class:`int` objects.
729729
730-
See the :c:struct:`PyLongLayout` structure.
730+
See the :c:type:`PyLongLayout` structure.
731731
732732
The function must not be called before Python initialization nor after
733733
Python finalization. The returned layout is valid until Python is
734734
finalized. The layout is the same for all Python sub-interpreters
735735
in a process, and so it can be cached.
736736
737737
738-
.. c:struct:: PyLongExport
738+
.. c:type:: PyLongExport
739739
740740
Export of a Python :class:`int` object.
741741
@@ -769,7 +769,7 @@ Export API
769769
770770
Export a Python :class:`int` object.
771771
772-
*export_long* must point to a :c:struct:`PyLongExport` structure allocated
772+
*export_long* must point to a :c:type:`PyLongExport` structure allocated
773773
by the caller. It must not be ``NULL``.
774774
775775
On success, fill in *\*export_long* and return ``0``.
@@ -799,7 +799,7 @@ The :c:type:`PyLongWriter` API can be used to import an integer.
799799
800800
.. versionadded:: 3.14
801801
802-
.. c:struct:: PyLongWriter
802+
.. c:type:: PyLongWriter
803803
804804
A Python :class:`int` writer instance.
805805
@@ -827,7 +827,7 @@ The :c:type:`PyLongWriter` API can be used to import an integer.
827827
The layout of *digits* is described by :c:func:`PyLong_GetNativeLayout`.
828828
829829
Digits must be in the range [``0``; ``(1 << bits_per_digit) - 1``]
830-
(where the :c:struct:`~PyLongLayout.bits_per_digit` is the number of bits
830+
(where the :c:type:`~PyLongLayout.bits_per_digit` is the number of bits
831831
per digit).
832832
Any unused most significant digits must be set to ``0``.
833833

Doc/data/stable_abi.dat

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Doc/howto/remote_debugging.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ execute Python code remotely.
88

99
Most platforms require elevated privileges to attach to another Python process.
1010

11+
Disabling remote debugging
12+
--------------------------
13+
14+
To disable remote debugging support, use any of the following:
15+
16+
* Set the :envvar:`PYTHON_DISABLE_REMOTE_DEBUG` environment variable to ``1`` before
17+
starting the interpreter.
18+
* Use the :option:`-X disable_remote_debug` command-line option.
19+
* Compile Python with the :option:`--without-remote-debug` build flag.
20+
1121
.. _permission-requirements:
1222

1323
Permission requirements
@@ -614,4 +624,3 @@ To inject and execute a Python script in a remote process:
614624
6. Set ``_PY_EVAL_PLEASE_STOP_BIT`` in the ``eval_breaker`` field.
615625
7. Resume the process (if suspended). The script will execute at the next safe
616626
evaluation point.
617-

Doc/library/sys.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1997,6 +1997,9 @@ always available. Unless explicitly noted otherwise, all variables are read-only
19971997
interpreter is pre-release (alpha, beta, or release candidate) then the
19981998
local and remote interpreters must be the same exact version.
19991999

2000+
See :ref:`remote-debugging` for more information about the remote debugging
2001+
mechanism.
2002+
20002003
.. audit-event:: sys.remote_exec pid script_path
20012004

20022005
When the code is executed in the remote process, an
@@ -2015,6 +2018,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
20152018

20162019
.. availability:: Unix, Windows.
20172020
.. versionadded:: 3.14
2021+
See :pep:`768` for more details.
20182022

20192023

20202024
.. function:: _enablelegacywindowsfsencoding()

Doc/using/windows.rst

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,8 @@ is also an unambiguous ``pymanager`` command. Scripted installs that are
126126
intending to use Python install manager should consider using ``pymanager``, due
127127
to the lower chance of encountering a conflict with existing installs. The only
128128
difference between the two commands is when running without any arguments:
129-
``py`` will install and launch your default interpreter, while ``pymanager``
130-
will display help (``pymanager exec ...`` provides equivalent behaviour to
131-
``py ...``).
129+
``py`` will launch your default interpreter, while ``pymanager`` will display
130+
help (``pymanager exec ...`` provides equivalent behaviour to ``py ...``).
132131

133132
Each of these commands also has a windowed version that avoids creating a
134133
console window. These are ``pyw``, ``pythonw`` and ``pymanagerw``. A ``python3``
@@ -187,12 +186,11 @@ that virtual environment. In this scenario, the ``python`` command was likely
187186
already overridden and none of these checks occurred. However, this behaviour
188187
ensures that the ``py`` command can be used interchangeably.
189188

190-
When you launch either ``python`` or ``py`` but do not have any runtimes
191-
installed, and the requested version is the default, it will be installed
192-
automatically and then launched. Otherwise, the requested version will be
193-
installed if automatic installation is configured (most likely by setting
194-
``PYTHON_MANAGER_AUTOMATIC_INSTALL`` to ``true``), or if the ``py exec`` or
195-
``pymanager exec`` forms of the command were used.
189+
When no runtimes are installed, any launch command will try to install the
190+
requested version and launch it. However, after any version is installed, only
191+
the ``py exec ...`` and ``pymanager exec ...`` commands will install if the
192+
requested version is absent. Other forms of commands will display an error and
193+
direct you to use ``py install`` first.
196194

197195

198196
Command help
@@ -301,6 +299,14 @@ To launch the runtime, directly execute the main executable (typically
301299
302300
$> py install ... [-t=|--target=<PATH>] <TAG>
303301
302+
The ``py exec`` command will install the requested runtime if it is not already
303+
present. This is controlled by the ``automatic_install`` configuration
304+
(:envvar:`PYTHON_MANAGER_AUTOMATIC_INSTALL`), and is enabled by default.
305+
If no runtimes are available at all, all launch commands will do an automatic
306+
install if the configuration setting allows. This is to ensure a good experience
307+
for new users, but should not generally be relied on rather than using the
308+
``py exec`` command or explicit install commands.
309+
304310

305311
.. _pymanager-offline:
306312

@@ -426,9 +432,11 @@ customization.
426432
By default, :file:`%TEMP%`.
427433

428434
* - ``automatic_install``
429-
- ``PYTHON_MANAGER_AUTOMATIC_INSTALL``
430-
- True to allow automatic installs when using ``py exec`` to launch.
431-
Other commands will not automatically install.
435+
- .. envvar:: PYTHON_MANAGER_AUTOMATIC_INSTALL
436+
- True to allow automatic installs when using ``py exec`` to launch (or
437+
``py`` when no runtimes are installed yet).
438+
Other commands will not automatically install, regardless of this
439+
setting.
432440
By default, true.
433441

434442
* - ``include_unmanaged``
@@ -777,7 +785,7 @@ Troubleshooting
777785

778786
If your Python install manager does not seem to be working correctly, please
779787
work through these tests and fixes to see if it helps. If not, please report an
780-
issue at `our bug tracker <https://github.com/python/cpython/issues>`_,
788+
issue at `our bug tracker <https://github.com/python/pymanager/issues>`_,
781789
including any relevant log files (written to your :file:`%TEMP%` directory by
782790
default).
783791

Include/cpython/longintrepr.h

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -138,45 +138,6 @@ _PyLong_CompactValue(const PyLongObject *op)
138138

139139
#define PyUnstable_Long_CompactValue _PyLong_CompactValue
140140

141-
142-
/* --- Import/Export API -------------------------------------------------- */
143-
144-
typedef struct PyLongLayout {
145-
uint8_t bits_per_digit;
146-
uint8_t digit_size;
147-
int8_t digits_order;
148-
int8_t digit_endianness;
149-
} PyLongLayout;
150-
151-
PyAPI_FUNC(const PyLongLayout*) PyLong_GetNativeLayout(void);
152-
153-
typedef struct PyLongExport {
154-
int64_t value;
155-
uint8_t negative;
156-
Py_ssize_t ndigits;
157-
const void *digits;
158-
// Member used internally, must not be used for other purpose.
159-
Py_uintptr_t _reserved;
160-
} PyLongExport;
161-
162-
PyAPI_FUNC(int) PyLong_Export(
163-
PyObject *obj,
164-
PyLongExport *export_long);
165-
PyAPI_FUNC(void) PyLong_FreeExport(
166-
PyLongExport *export_long);
167-
168-
169-
/* --- PyLongWriter API --------------------------------------------------- */
170-
171-
typedef struct PyLongWriter PyLongWriter;
172-
173-
PyAPI_FUNC(PyLongWriter*) PyLongWriter_Create(
174-
int negative,
175-
Py_ssize_t ndigits,
176-
void **digits);
177-
PyAPI_FUNC(PyObject*) PyLongWriter_Finish(PyLongWriter *writer);
178-
PyAPI_FUNC(void) PyLongWriter_Discard(PyLongWriter *writer);
179-
180141
#ifdef __cplusplus
181142
}
182143
#endif

Include/internal/pycore_optimizer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ extern JitOptRef _Py_uop_sym_new_truthiness(JitOptContext *ctx, JitOptRef value,
205205
extern bool _Py_uop_sym_is_compact_int(JitOptRef sym);
206206
extern JitOptRef _Py_uop_sym_new_compact_int(JitOptContext *ctx);
207207
extern void _Py_uop_sym_set_compact_int(JitOptContext *ctx, JitOptRef sym);
208+
extern JitOptRef _Py_uop_sym_new_predicate(JitOptContext *ctx, JitOptRef lhs_ref, JitOptRef rhs_ref, JitOptPredicateKind kind);
209+
extern void _Py_uop_sym_apply_predicate_narrowing(JitOptContext *ctx, JitOptRef sym, bool branch_is_true);
208210

209211
extern void _Py_uop_abstractcontext_init(JitOptContext *ctx);
210212
extern void _Py_uop_abstractcontext_fini(JitOptContext *ctx);

0 commit comments

Comments
 (0)