Skip to content

Commit 44d19be

Browse files
committed
Merge remote-tracking branch 'upstream/main' into binary_subscr
2 parents c1e7681 + 379ab85 commit 44d19be

File tree

145 files changed

+3129
-1834
lines changed

Some content is hidden

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

145 files changed

+3129
-1834
lines changed

Android/android-env.sh

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# This script must be sourced with the following variables already set:
2-
: ${ANDROID_HOME:?} # Path to Android SDK
3-
: ${HOST:?} # GNU target triplet
2+
: "${ANDROID_HOME:?}" # Path to Android SDK
3+
: "${HOST:?}" # GNU target triplet
44

55
# You may also override the following:
6-
: ${api_level:=24} # Minimum Android API level the build will run on
7-
: ${PREFIX:-} # Path in which to find required libraries
6+
: "${api_level:=24}" # Minimum Android API level the build will run on
7+
: "${PREFIX:-}" # Path in which to find required libraries
88

99

1010
# Print all messages on stderr so they're visible when running within build-wheel.
@@ -27,20 +27,20 @@ fail() {
2727
ndk_version=27.1.12297006
2828

2929
ndk=$ANDROID_HOME/ndk/$ndk_version
30-
if ! [ -e $ndk ]; then
30+
if ! [ -e "$ndk" ]; then
3131
log "Installing NDK - this may take several minutes"
32-
yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "ndk;$ndk_version"
32+
yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "ndk;$ndk_version"
3333
fi
3434

35-
if [ $HOST = "arm-linux-androideabi" ]; then
35+
if [ "$HOST" = "arm-linux-androideabi" ]; then
3636
clang_triplet=armv7a-linux-androideabi
3737
else
38-
clang_triplet=$HOST
38+
clang_triplet="$HOST"
3939
fi
4040

4141
# These variables are based on BuildSystemMaintainers.md above, and
4242
# $ndk/build/cmake/android.toolchain.cmake.
43-
toolchain=$(echo $ndk/toolchains/llvm/prebuilt/*)
43+
toolchain=$(echo "$ndk"/toolchains/llvm/prebuilt/*)
4444
export AR="$toolchain/bin/llvm-ar"
4545
export AS="$toolchain/bin/llvm-as"
4646
export CC="$toolchain/bin/${clang_triplet}${api_level}-clang"
@@ -72,12 +72,12 @@ LDFLAGS="$LDFLAGS -lm"
7272

7373
# -mstackrealign is included where necessary in the clang launcher scripts which are
7474
# pointed to by $CC, so we don't need to include it here.
75-
if [ $HOST = "arm-linux-androideabi" ]; then
75+
if [ "$HOST" = "arm-linux-androideabi" ]; then
7676
CFLAGS="$CFLAGS -march=armv7-a -mthumb"
7777
fi
7878

7979
if [ -n "${PREFIX:-}" ]; then
80-
abs_prefix=$(realpath $PREFIX)
80+
abs_prefix="$(realpath "$PREFIX")"
8181
CFLAGS="$CFLAGS -I$abs_prefix/include"
8282
LDFLAGS="$LDFLAGS -L$abs_prefix/lib"
8383

@@ -87,11 +87,13 @@ fi
8787

8888
# When compiling C++, some build systems will combine CFLAGS and CXXFLAGS, and some will
8989
# use CXXFLAGS alone.
90-
export CXXFLAGS=$CFLAGS
90+
export CXXFLAGS="$CFLAGS"
9191

9292
# Use the same variable name as conda-build
93-
if [ $(uname) = "Darwin" ]; then
94-
export CPU_COUNT=$(sysctl -n hw.ncpu)
93+
if [ "$(uname)" = "Darwin" ]; then
94+
CPU_COUNT="$(sysctl -n hw.ncpu)"
95+
export CPU_COUNT
9596
else
96-
export CPU_COUNT=$(nproc)
97+
CPU_COUNT="$(nproc)"
98+
export CPU_COUNT
9799
fi

Doc/c-api/long.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,6 @@ The :c:type:`PyLongWriter` API can be used to import an integer.
824824
825825
Discard a :c:type:`PyLongWriter` created by :c:func:`PyLongWriter_Create`.
826826
827-
*writer* must not be ``NULL``.
827+
If *writer* is ``NULL``, no operation is performed.
828828
829829
The writer instance and the *digits* array are invalid after the call.

Doc/c-api/object.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,3 +613,14 @@ Object Protocol
613613
614614
.. versionadded:: 3.14
615615
616+
.. c:function:: int PyUnstable_IsImmortal(PyObject *obj)
617+
618+
This function returns non-zero if *obj* is :term:`immortal`, and zero
619+
otherwise. This function cannot fail.
620+
621+
.. note::
622+
623+
Objects that are immortal in one CPython version are not guaranteed to
624+
be immortal in another.
625+
626+
.. versionadded:: next

Doc/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,6 @@
560560
r'https://github.com/python/cpython/tree/.*': 'https://github.com/python/cpython/blob/.*',
561561
# Intentional HTTP use at Misc/NEWS.d/3.5.0a1.rst
562562
r'http://www.python.org/$': 'https://www.python.org/$',
563-
# Used in license page, keep as is
564-
r'https://www.zope.org/': r'https://www.zope.dev/',
565563
# Microsoft's redirects to learn.microsoft.com
566564
r'https://msdn.microsoft.com/.*': 'https://learn.microsoft.com/.*',
567565
r'https://docs.microsoft.com/.*': 'https://learn.microsoft.com/.*',

Doc/deprecations/c-api-pending-removal-in-3.18.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Pending removal in Python 3.18
77
* :c:func:`!_PyDict_GetItemStringWithError`: use :c:func:`PyDict_GetItemStringRef`.
88
* :c:func:`!_PyDict_Pop()`: :c:func:`PyDict_Pop`.
99
* :c:func:`!_PyLong_Sign()`: use :c:func:`PyLong_GetSign`.
10-
* :c:func:`!_PyLong_New`: use :c:func:`PyLongWriter_Create`.
10+
* :c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`:
11+
use :c:func:`PyLongWriter_Create`.
1112
* :c:func:`!_PyThreadState_UncheckedGet`: use :c:func:`PyThreadState_GetUnchecked`.
1213
* :c:func:`!_PyUnicode_AsString`: use :c:func:`PyUnicode_AsUTF8`.
1314
* :c:func:`!_Py_HashPointer`: use :c:func:`Py_HashPointer`.

Doc/deprecations/c-api-pending-removal-in-future.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ although there is currently no date scheduled for their removal.
3434
Use :c:func:`!_PyErr_ChainExceptions1` instead.
3535
* :c:member:`!PyBytesObject.ob_shash` member:
3636
call :c:func:`PyObject_Hash` instead.
37-
* :c:member:`!PyDictObject.ma_version_tag` member.
3837
* Thread Local Storage (TLS) API:
3938

4039
* :c:func:`PyThread_create_key`:

Doc/library/asyncio-graph.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ and debuggers.
5959
6060
async def main():
6161
async with asyncio.TaskGroup() as g:
62-
g.create_task(test())
62+
g.create_task(test(), name='test')
6363
6464
asyncio.run(main())
6565
6666
will print::
6767

68-
* Task(name='Task-2', id=0x1039f0fe0)
68+
* Task(name='test', id=0x1039f0fe0)
6969
+ Call stack:
7070
| File 't2.py', line 4, in async test()
7171
+ Awaited by:

Doc/library/http.cookies.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ Morsel Objects
142142
version
143143
httponly
144144
samesite
145+
partitioned
145146

146147
The attribute :attr:`httponly` specifies that the cookie is only transferred
147148
in HTTP requests, and is not accessible through JavaScript. This is intended
@@ -151,6 +152,19 @@ Morsel Objects
151152
send the cookie along with cross-site requests. This helps to mitigate CSRF
152153
attacks. Valid values for this attribute are "Strict" and "Lax".
153154

155+
The attribute :attr:`partitioned` indicates to user agents that these
156+
cross-site cookies *should* only be available in the same top-level context
157+
that the cookie was first set in. For this to be accepted by the user agent,
158+
you **must** also set ``Secure``.
159+
160+
In addition, it is recommended to use the ``__Host`` prefix when setting
161+
partitioned cookies to make them bound to the hostname and not the
162+
registrable domain. Read
163+
`CHIPS (Cookies Having Independent Partitioned State)`_
164+
for full details and examples.
165+
166+
.. _CHIPS (Cookies Having Independent Partitioned State): https://github.com/privacycg/CHIPS/blob/main/README.md
167+
154168
The keys are case-insensitive and their default value is ``''``.
155169

156170
.. versionchanged:: 3.5
@@ -165,6 +179,9 @@ Morsel Objects
165179
.. versionchanged:: 3.8
166180
Added support for the :attr:`samesite` attribute.
167181

182+
.. versionchanged:: 3.14
183+
Added support for the :attr:`partitioned` attribute.
184+
168185

169186
.. attribute:: Morsel.value
170187

Doc/library/os.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,6 +1659,33 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
16591659
:exc:`InterruptedError` exception (see :pep:`475` for the rationale).
16601660

16611661

1662+
.. function:: readinto(fd, buffer, /)
1663+
1664+
Read from a file descriptor *fd* into a mutable
1665+
:ref:`buffer object <bufferobjects>` *buffer*.
1666+
1667+
The *buffer* should be mutable and :term:`bytes-like <bytes-like object>`. On
1668+
success, returns the number of bytes read. Less bytes may be read than the
1669+
size of the buffer. The underlying system call will be retried when
1670+
interrupted by a signal, unless the signal handler raises an exception.
1671+
Other errors will not be retried and an error will be raised.
1672+
1673+
Returns 0 if *fd* is at end of file or if the provided *buffer* has
1674+
length 0 (which can be used to check for errors without reading data).
1675+
Never returns negative.
1676+
1677+
.. note::
1678+
1679+
This function is intended for low-level I/O and must be applied to a file
1680+
descriptor as returned by :func:`os.open` or :func:`os.pipe`. To read a
1681+
"file object" returned by the built-in function :func:`open`, or
1682+
:data:`sys.stdin`, use its member functions, for example
1683+
:meth:`io.BufferedIOBase.readinto`, :meth:`io.BufferedIOBase.read`, or
1684+
:meth:`io.TextIOBase.read`
1685+
1686+
.. versionadded:: next
1687+
1688+
16621689
.. function:: sendfile(out_fd, in_fd, offset, count)
16631690
sendfile(out_fd, in_fd, offset, count, headers=(), trailers=(), flags=0)
16641691

Doc/library/uuid.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,25 @@ of the :attr:`~UUID.variant` attribute:
289289
Reserved for future definition.
290290

291291

292+
The :mod:`uuid` module defines the special Nil and Max UUID values:
293+
294+
295+
.. data:: NIL
296+
297+
A special form of UUID that is specified to have all 128 bits set to zero
298+
according to :rfc:`RFC 9562, §5.9 <9562#section-5.9>`.
299+
300+
.. versionadded:: next
301+
302+
303+
.. data:: MAX
304+
305+
A special form of UUID that is specified to have all 128 bits set to one
306+
according to :rfc:`RFC 9562, §5.10 <9562#section-5.10>`.
307+
308+
.. versionadded:: next
309+
310+
292311
.. seealso::
293312

294313
:rfc:`9562` - A Universally Unique IDentifier (UUID) URN Namespace
@@ -380,6 +399,14 @@ Here are some examples of typical usage of the :mod:`uuid` module::
380399
>>> uuid.UUID(bytes=x.bytes)
381400
UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')
382401

402+
>>> # get the Nil UUID
403+
>>> uuid.NIL
404+
UUID('00000000-0000-0000-0000-000000000000')
405+
406+
>>> # get the Max UUID
407+
>>> uuid.MAX
408+
UUID('ffffffff-ffff-ffff-ffff-ffffffffffff')
409+
383410

384411
.. _uuid-cli-example:
385412

0 commit comments

Comments
 (0)