Skip to content

Commit fd90cab

Browse files
committed
Merge branch 'main' into deprecate_writer
2 parents c8e6c22 + 180ee43 commit fd90cab

File tree

137 files changed

+2973
-1684
lines changed

Some content is hidden

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

137 files changed

+2973
-1684
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:`!_PyUnicodeWriter_Init`:

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/errno.rst

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,171 @@ defined by the module. The specific list of defined symbols is available as
672672

673673
.. versionadded:: 3.11
674674

675+
676+
.. data:: ENOMEDIUM
677+
678+
No medium found
679+
680+
681+
.. data:: EMEDIUMTYPE
682+
683+
Wrong medium type
684+
685+
686+
.. data:: ENOKEY
687+
688+
Required key not available
689+
690+
691+
.. data:: EKEYEXPIRED
692+
693+
Key has expired
694+
695+
696+
.. data:: EKEYREVOKED
697+
698+
Key has been revoked
699+
700+
701+
.. data:: EKEYREJECTED
702+
703+
Key was rejected by service
704+
705+
706+
.. data:: ERFKILL
707+
708+
Operation not possible due to RF-kill
709+
710+
711+
.. data:: ELOCKUNMAPPED
712+
713+
Locked lock was unmapped
714+
715+
716+
.. data:: ENOTACTIVE
717+
718+
Facility is not active
719+
720+
721+
.. data:: EAUTH
722+
723+
Authentication error
724+
725+
.. versionadded:: 3.2
726+
727+
728+
.. data:: EBADARCH
729+
730+
Bad CPU type in executable
731+
732+
.. versionadded:: 3.2
733+
734+
735+
.. data:: EBADEXEC
736+
737+
Bad executable (or shared library)
738+
739+
.. versionadded:: 3.2
740+
741+
742+
.. data:: EBADMACHO
743+
744+
Malformed Mach-o file
745+
746+
.. versionadded:: 3.2
747+
748+
749+
.. data:: EDEVERR
750+
751+
Device error
752+
753+
.. versionadded:: 3.2
754+
755+
756+
.. data:: EFTYPE
757+
758+
Inappropriate file type or format
759+
760+
.. versionadded:: 3.2
761+
762+
763+
.. data:: ENEEDAUTH
764+
765+
Need authenticator
766+
767+
.. versionadded:: 3.2
768+
769+
770+
.. data:: ENOATTR
771+
772+
Attribute not found
773+
774+
.. versionadded:: 3.2
775+
776+
777+
.. data:: ENOPOLICY
778+
779+
Policy not found
780+
781+
.. versionadded:: 3.2
782+
783+
784+
.. data:: EPROCLIM
785+
786+
Too many processes
787+
788+
.. versionadded:: 3.2
789+
790+
791+
.. data:: EPROCUNAVAIL
792+
793+
Bad procedure for program
794+
795+
.. versionadded:: 3.2
796+
797+
798+
.. data:: EPROGMISMATCH
799+
800+
Program version wrong
801+
802+
.. versionadded:: 3.2
803+
804+
805+
.. data:: EPROGUNAVAIL
806+
807+
RPC prog. not avail
808+
809+
.. versionadded:: 3.2
810+
811+
812+
.. data:: EPWROFF
813+
814+
Device power is off
815+
816+
.. versionadded:: 3.2
817+
818+
819+
.. data:: EBADRPC
820+
821+
RPC struct is bad
822+
823+
.. versionadded:: 3.2
824+
825+
826+
.. data:: ERPCMISMATCH
827+
828+
RPC version wrong
829+
830+
.. versionadded:: 3.2
831+
832+
833+
.. data:: ESHLIBVERS
834+
835+
Shared library version mismatch
836+
837+
.. versionadded:: 3.2
838+
839+
675840
.. data:: ENOTCAPABLE
676841

677842
Capabilities insufficient. This error is mapped to the exception

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

0 commit comments

Comments
 (0)