Skip to content

Commit 4259dca

Browse files
Merge branch 'main' into gh-129288
2 parents 4c123f6 + 87fb8b1 commit 4259dca

Some content is hidden

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

62 files changed

+1374
-395
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/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/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/license.rst

Lines changed: 58 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -11,59 +11,63 @@ History of the software
1111
=======================
1212

1313
Python was created in the early 1990s by Guido van Rossum at Stichting
14-
Mathematisch Centrum (CWI, see https://www.cwi.nl/) in the Netherlands as a
14+
Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands as a
1515
successor of a language called ABC. Guido remains Python's principal author,
1616
although it includes many contributions from others.
1717

1818
In 1995, Guido continued his work on Python at the Corporation for National
19-
Research Initiatives (CNRI, see https://www.cnri.reston.va.us/) in Reston,
19+
Research Initiatives (CNRI, see https://www.cnri.reston.va.us) in Reston,
2020
Virginia where he released several versions of the software.
2121

2222
In May 2000, Guido and the Python core development team moved to BeOpen.com to
2323
form the BeOpen PythonLabs team. In October of the same year, the PythonLabs
24-
team moved to Digital Creations (now Zope Corporation; see
25-
https://www.zope.org/). In 2001, the Python Software Foundation (PSF, see
24+
team moved to Digital Creations, which became
25+
Zope Corporation. In 2001, the Python Software Foundation (PSF, see
2626
https://www.python.org/psf/) was formed, a non-profit organization created
27-
specifically to own Python-related Intellectual Property. Zope Corporation is a
27+
specifically to own Python-related Intellectual Property. Zope Corporation was a
2828
sponsoring member of the PSF.
2929

30-
All Python releases are Open Source (see https://opensource.org/ for the Open
30+
All Python releases are Open Source (see https://opensource.org for the Open
3131
Source Definition). Historically, most, but not all, Python releases have also
3232
been GPL-compatible; the table below summarizes the various releases.
3333

34-
+----------------+--------------+------------+------------+-----------------+
35-
| Release | Derived from | Year | Owner | GPL compatible? |
36-
+================+==============+============+============+=================+
37-
| 0.9.0 thru 1.2 | n/a | 1991-1995 | CWI | yes |
38-
+----------------+--------------+------------+------------+-----------------+
39-
| 1.3 thru 1.5.2 | 1.2 | 1995-1999 | CNRI | yes |
40-
+----------------+--------------+------------+------------+-----------------+
41-
| 1.6 | 1.5.2 | 2000 | CNRI | no |
42-
+----------------+--------------+------------+------------+-----------------+
43-
| 2.0 | 1.6 | 2000 | BeOpen.com | no |
44-
+----------------+--------------+------------+------------+-----------------+
45-
| 1.6.1 | 1.6 | 2001 | CNRI | no |
46-
+----------------+--------------+------------+------------+-----------------+
47-
| 2.1 | 2.0+1.6.1 | 2001 | PSF | no |
48-
+----------------+--------------+------------+------------+-----------------+
49-
| 2.0.1 | 2.0+1.6.1 | 2001 | PSF | yes |
50-
+----------------+--------------+------------+------------+-----------------+
51-
| 2.1.1 | 2.1+2.0.1 | 2001 | PSF | yes |
52-
+----------------+--------------+------------+------------+-----------------+
53-
| 2.1.2 | 2.1.1 | 2002 | PSF | yes |
54-
+----------------+--------------+------------+------------+-----------------+
55-
| 2.1.3 | 2.1.2 | 2002 | PSF | yes |
56-
+----------------+--------------+------------+------------+-----------------+
57-
| 2.2 and above | 2.1.1 | 2001-now | PSF | yes |
58-
+----------------+--------------+------------+------------+-----------------+
34+
+----------------+--------------+------------+------------+---------------------+
35+
| Release | Derived from | Year | Owner | GPL-compatible? (1) |
36+
+================+==============+============+============+=====================+
37+
| 0.9.0 thru 1.2 | n/a | 1991-1995 | CWI | yes |
38+
+----------------+--------------+------------+------------+---------------------+
39+
| 1.3 thru 1.5.2 | 1.2 | 1995-1999 | CNRI | yes |
40+
+----------------+--------------+------------+------------+---------------------+
41+
| 1.6 | 1.5.2 | 2000 | CNRI | no |
42+
+----------------+--------------+------------+------------+---------------------+
43+
| 2.0 | 1.6 | 2000 | BeOpen.com | no |
44+
+----------------+--------------+------------+------------+---------------------+
45+
| 1.6.1 | 1.6 | 2001 | CNRI | yes (2) |
46+
+----------------+--------------+------------+------------+---------------------+
47+
| 2.1 | 2.0+1.6.1 | 2001 | PSF | no |
48+
+----------------+--------------+------------+------------+---------------------+
49+
| 2.0.1 | 2.0+1.6.1 | 2001 | PSF | yes |
50+
+----------------+--------------+------------+------------+---------------------+
51+
| 2.1.1 | 2.1+2.0.1 | 2001 | PSF | yes |
52+
+----------------+--------------+------------+------------+---------------------+
53+
| 2.1.2 | 2.1.1 | 2002 | PSF | yes |
54+
+----------------+--------------+------------+------------+---------------------+
55+
| 2.1.3 | 2.1.2 | 2002 | PSF | yes |
56+
+----------------+--------------+------------+------------+---------------------+
57+
| 2.2 and above | 2.1.1 | 2001-now | PSF | yes |
58+
+----------------+--------------+------------+------------+---------------------+
5959

6060
.. note::
6161

62-
GPL-compatible doesn't mean that we're distributing Python under the GPL. All
63-
Python licenses, unlike the GPL, let you distribute a modified version without
64-
making your changes open source. The GPL-compatible licenses make it possible to
65-
combine Python with other software that is released under the GPL; the others
66-
don't.
62+
(1) GPL-compatible doesn't mean that we're distributing Python under the GPL.
63+
All Python licenses, unlike the GPL, let you distribute a modified version
64+
without making your changes open source. The GPL-compatible licenses make
65+
it possible to combine Python with other software that is released under
66+
the GPL; the others don't.
67+
68+
(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, because its license
69+
has a choice of law clause. According to CNRI, however, Stallman's lawyer has
70+
told CNRI's lawyer that 1.6.1 is "not incompatible" with the GPL.
6771

6872
Thanks to the many outside volunteers who have worked under Guido's direction to
6973
make these releases possible.
@@ -73,10 +77,10 @@ Terms and conditions for accessing or otherwise using Python
7377
============================================================
7478

7579
Python software and documentation are licensed under the
76-
:ref:`PSF License Agreement <PSF-license>`.
80+
Python Software Foundation License Version 2.
7781

7882
Starting with Python 3.8.6, examples, recipes, and other code in
79-
the documentation are dual licensed under the PSF License Agreement
83+
the documentation are dual licensed under the PSF License Version 2
8084
and the :ref:`Zero-Clause BSD license <BSD0>`.
8185

8286
Some software incorporated into Python is under different licenses.
@@ -86,39 +90,38 @@ See :ref:`OtherLicenses` for an incomplete list of these licenses.
8690

8791
.. _PSF-license:
8892

89-
PSF LICENSE AGREEMENT FOR PYTHON |release|
90-
------------------------------------------
93+
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
94+
--------------------------------------------
9195

9296
.. parsed-literal::
9397
9498
1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and
95-
the Individual or Organization ("Licensee") accessing and otherwise using Python
96-
|release| software in source or binary form and its associated documentation.
99+
the Individual or Organization ("Licensee") accessing and otherwise using this
100+
software ("Python") in source or binary form and its associated documentation.
97101
98102
2. Subject to the terms and conditions of this License Agreement, PSF hereby
99103
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
100104
analyze, test, perform and/or display publicly, prepare derivative works,
101-
distribute, and otherwise use Python |release| alone or in any derivative
105+
distribute, and otherwise use Python alone or in any derivative
102106
version, provided, however, that PSF's License Agreement and PSF's notice of
103107
copyright, i.e., "Copyright © 2001 Python Software Foundation; All Rights
104-
Reserved" are retained in Python |release| alone or in any derivative version
108+
Reserved" are retained in Python alone or in any derivative version
105109
prepared by Licensee.
106110
107111
3. In the event Licensee prepares a derivative work that is based on or
108-
incorporates Python |release| or any part thereof, and wants to make the
112+
incorporates Python or any part thereof, and wants to make the
109113
derivative work available to others as provided herein, then Licensee hereby
110-
agrees to include in any such work a brief summary of the changes made to Python
111-
|release|.
114+
agrees to include in any such work a brief summary of the changes made to Python.
112115
113-
4. PSF is making Python |release| available to Licensee on an "AS IS" basis.
116+
4. PSF is making Python available to Licensee on an "AS IS" basis.
114117
PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF
115118
EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR
116119
WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE
117-
USE OF PYTHON |release| WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
120+
USE OF PYTHON WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
118121
119-
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON |release|
122+
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
120123
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF
121-
MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON |release|, OR ANY DERIVATIVE
124+
MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, OR ANY DERIVATIVE
122125
THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
123126
124127
6. This License Agreement will automatically terminate upon a material breach of
@@ -130,7 +133,7 @@ PSF LICENSE AGREEMENT FOR PYTHON |release|
130133
trademark sense to endorse or promote products or services of Licensee, or any
131134
third party.
132135
133-
8. By copying, installing or otherwise using Python |release|, Licensee agrees
136+
8. By copying, installing or otherwise using Python, Licensee agrees
134137
to be bound by the terms and conditions of this License Agreement.
135138
136139
@@ -205,7 +208,7 @@ CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
205208
Agreement. This Agreement together with Python 1.6.1 may be located on the
206209
internet using the following unique, persistent identifier (known as a handle):
207210
1895.22/1013. This Agreement may also be obtained from a proxy server on the
208-
internet using the following URL: http://hdl.handle.net/1895.22/1013."
211+
internet using the following URL: http://hdl.handle.net/1895.22/1013".
209212
210213
3. In the event Licensee prepares a derivative work that is based on or
211214
incorporates Python 1.6.1 or any part thereof, and wants to make the derivative
@@ -273,8 +276,8 @@ CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
273276
274277
.. _BSD0:
275278

276-
ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON |release| DOCUMENTATION
277-
----------------------------------------------------------------------
279+
ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION
280+
------------------------------------------------------------
278281

279282
.. parsed-literal::
280283

Doc/reference/import.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -762,10 +762,10 @@ module.
762762

763763
The current working directory -- denoted by an empty string -- is handled
764764
slightly differently from other entries on :data:`sys.path`. First, if the
765-
current working directory is found to not exist, no value is stored in
766-
:data:`sys.path_importer_cache`. Second, the value for the current working
767-
directory is looked up fresh for each module lookup. Third, the path used for
768-
:data:`sys.path_importer_cache` and returned by
765+
current working directory cannot be determined or is found not to exist, no
766+
value is stored in :data:`sys.path_importer_cache`. Second, the value for the
767+
current working directory is looked up fresh for each module lookup. Third,
768+
the path used for :data:`sys.path_importer_cache` and returned by
769769
:meth:`importlib.machinery.PathFinder.find_spec` will be the actual current
770770
working directory and not the empty string.
771771

0 commit comments

Comments
 (0)