Skip to content

Commit f03f6b1

Browse files
committed
Merge branch 'main' into fix-issue-129068
2 parents 465efdf + 1e3ec33 commit f03f6b1

File tree

259 files changed

+4887
-2372
lines changed

Some content is hidden

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

259 files changed

+4887
-2372
lines changed

.github/CODEOWNERS

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,16 @@ Objects/exceptions.c @iritkatriel
107107
# Hashing & cryptographic primitives
108108
**/*hashlib* @gpshead @tiran @picnixz
109109
**/*hashopenssl* @gpshead @tiran @picnixz
110-
**/*pyhash* @gpshead @tiran
111-
**/sha* @gpshead @tiran @picnixz
112-
Modules/md5* @gpshead @tiran @picnixz
113-
**/*blake* @gpshead @tiran @picnixz
114-
Modules/_hacl/** @gpshead
110+
**/*pyhash* @gpshead @tiran @picnixz
111+
Modules/*blake* @gpshead @tiran @picnixz
112+
Modules/*md5* @gpshead @tiran @picnixz
113+
Modules/*sha* @gpshead @tiran @picnixz
114+
Modules/_hacl/** @gpshead @picnixz
115115
**/*hmac* @gpshead @picnixz
116116

117+
# libssl
118+
**/*ssl* @gpshead @picnixz
119+
117120
# logging
118121
**/*logging* @vsajip
119122

.github/workflows/tail-call.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ jobs:
8787
set PlatformToolset=clangcl
8888
set LLVMToolsVersion=${{ matrix.llvm }}.1.5
8989
set LLVMInstallDir=C:\Program Files\LLVM
90-
./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
91-
./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
90+
call ./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
91+
call ./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
9292
9393
# No tests (yet):
9494
- name: Emulated Windows (release)
@@ -112,8 +112,8 @@ jobs:
112112
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
113113
brew install llvm@${{ matrix.llvm }}
114114
export SDKROOT="$(xcrun --show-sdk-path)"
115-
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
116-
export PATH="/usr/local/opt/llvm/bin:$PATH"
115+
export PATH="/opt/homebrew/opt/llvm@${{ matrix.llvm }}/bin:$PATH"
116+
export PATH="/usr/local/opt/llvm@${{ matrix.llvm }}/bin:$PATH"
117117
CC=clang-19 ./configure --with-tail-call-interp
118118
make all --jobs 4
119119
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3

Doc/library/os.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3693,16 +3693,16 @@ features:
36933693

36943694
This example displays the number of bytes taken by non-directory files in each
36953695
directory under the starting directory, except that it doesn't look under any
3696-
CVS subdirectory::
3696+
``__pycache__`` subdirectory::
36973697

36983698
import os
36993699
from os.path import join, getsize
3700-
for root, dirs, files in os.walk('python/Lib/email'):
3700+
for root, dirs, files in os.walk('python/Lib/xml'):
37013701
print(root, "consumes", end=" ")
37023702
print(sum(getsize(join(root, name)) for name in files), end=" ")
37033703
print("bytes in", len(files), "non-directory files")
3704-
if 'CVS' in dirs:
3705-
dirs.remove('CVS') # don't visit CVS directories
3704+
if '__pycache__' in dirs:
3705+
dirs.remove('__pycache__') # don't visit __pycache__ directories
37063706

37073707
In the next example (simple implementation of :func:`shutil.rmtree`),
37083708
walking the tree bottom-up is essential, :func:`rmdir` doesn't allow
@@ -3755,16 +3755,16 @@ features:
37553755

37563756
This example displays the number of bytes taken by non-directory files in each
37573757
directory under the starting directory, except that it doesn't look under any
3758-
CVS subdirectory::
3758+
``__pycache__`` subdirectory::
37593759

37603760
import os
3761-
for root, dirs, files, rootfd in os.fwalk('python/Lib/email'):
3761+
for root, dirs, files, rootfd in os.fwalk('python/Lib/xml'):
37623762
print(root, "consumes", end="")
37633763
print(sum([os.stat(name, dir_fd=rootfd).st_size for name in files]),
37643764
end="")
37653765
print("bytes in", len(files), "non-directory files")
3766-
if 'CVS' in dirs:
3767-
dirs.remove('CVS') # don't visit CVS directories
3766+
if '__pycache__' in dirs:
3767+
dirs.remove('__pycache__') # don't visit __pycache__ directories
37683768

37693769
In the next example, walking the tree bottom-up is essential:
37703770
:func:`rmdir` doesn't allow deleting a directory before the directory is

Doc/library/socket.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -882,10 +882,10 @@ The following functions all create :ref:`socket objects <socket-objects>`.
882882
, a default reasonable value is chosen.
883883
*reuse_port* dictates whether to set the :data:`SO_REUSEPORT` socket option.
884884

885-
If *dualstack_ipv6* is true and the platform supports it the socket will
886-
be able to accept both IPv4 and IPv6 connections, else it will raise
887-
:exc:`ValueError`. Most POSIX platforms and Windows are supposed to support
888-
this functionality.
885+
If *dualstack_ipv6* is true, *family* is :data:`AF_INET6` and the platform
886+
supports it the socket will be able to accept both IPv4 and IPv6 connections,
887+
else it will raise :exc:`ValueError`. Most POSIX platforms and Windows are
888+
supposed to support this functionality.
889889
When this functionality is enabled the address returned by
890890
:meth:`socket.getpeername` when an IPv4 connection occurs will be an IPv6
891891
address represented as an IPv4-mapped IPv6 address.

Doc/library/stdtypes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4780,7 +4780,7 @@ can be used interchangeably to index the same dictionary entry.
47804780
such as an empty list. To get distinct values, use a :ref:`dict
47814781
comprehension <dict>` instead.
47824782

4783-
.. method:: get(key, default=None)
4783+
.. method:: get(key, default=None, /)
47844784

47854785
Return the value for *key* if *key* is in the dictionary, else *default*.
47864786
If *default* is not given, it defaults to ``None``, so that this method
@@ -4822,7 +4822,7 @@ can be used interchangeably to index the same dictionary entry.
48224822

48234823
.. versionadded:: 3.8
48244824

4825-
.. method:: setdefault(key, default=None)
4825+
.. method:: setdefault(key, default=None, /)
48264826

48274827
If *key* is in the dictionary, return its value. If not, insert *key*
48284828
with a value of *default* and return *default*. *default* defaults to

Doc/library/sys.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,9 @@ always available. Unless explicitly noted otherwise, all variables are read-only
12471247

12481248
.. versionadded:: 3.13
12491249

1250+
.. impl-detail::
1251+
1252+
It is not guaranteed to exist in all implementations of Python.
12501253

12511254
.. function:: is_finalizing()
12521255

Doc/library/uuid.rst

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,28 +103,29 @@ which relays any information about the UUID's safety, using this enumeration:
103103
- Meaning
104104

105105
* - .. attribute:: UUID.time_low
106-
- The first 32 bits of the UUID.
106+
- The first 32 bits of the UUID. Only relevant to version 1.
107107

108108
* - .. attribute:: UUID.time_mid
109-
- The next 16 bits of the UUID.
109+
- The next 16 bits of the UUID. Only relevant to version 1.
110110

111111
* - .. attribute:: UUID.time_hi_version
112-
- The next 16 bits of the UUID.
112+
- The next 16 bits of the UUID. Only relevant to version 1.
113113

114114
* - .. attribute:: UUID.clock_seq_hi_variant
115-
- The next 8 bits of the UUID.
115+
- The next 8 bits of the UUID. Only relevant to versions 1 and 6.
116116

117117
* - .. attribute:: UUID.clock_seq_low
118-
- The next 8 bits of the UUID.
118+
- The next 8 bits of the UUID. Only relevant to versions 1 and 6.
119119

120120
* - .. attribute:: UUID.node
121-
- The last 48 bits of the UUID.
121+
- The last 48 bits of the UUID. Only relevant to version 1.
122122

123123
* - .. attribute:: UUID.time
124-
- The 60-bit timestamp.
124+
- The 60-bit timestamp for version 1 and 6,
125+
or the 48-bit timestamp for version 7.
125126

126127
* - .. attribute:: UUID.clock_seq
127-
- The 14-bit sequence number.
128+
- The 14-bit sequence number. Only relevant to versions 1 and 6.
128129

129130

130131
.. attribute:: UUID.hex
@@ -377,6 +378,13 @@ The following options are accepted:
377378
The name used as part of generating the uuid. Only required for
378379
:func:`uuid3` / :func:`uuid5` functions.
379380

381+
.. option:: -C <num>
382+
--count <num>
383+
384+
Generate *num* fresh UUIDs.
385+
386+
.. versionadded:: next
387+
380388

381389
.. _uuid-example:
382390

@@ -432,16 +440,18 @@ Here are some examples of typical usage of the :mod:`uuid` module::
432440
Command-Line Example
433441
--------------------
434442

435-
Here are some examples of typical usage of the :mod:`uuid` command line interface:
443+
Here are some examples of typical usage of the :mod:`uuid` command-line interface:
436444

437445
.. code-block:: shell
438446
439-
# generate a random uuid - by default uuid4() is used
447+
# generate a random UUID - by default uuid4() is used
440448
$ python -m uuid
441449
442-
# generate a uuid using uuid1()
450+
# generate a UUID using uuid1()
443451
$ python -m uuid -u uuid1
444452
445-
# generate a uuid using uuid5
453+
# generate a UUID using uuid5
446454
$ python -m uuid -u uuid5 -n @url -N example.com
447455
456+
# generate 42 random UUIDs
457+
$ python -m uuid -C 42

Doc/whatsnew/3.12.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,14 @@ pathlib
811811
:meth:`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching
812812
the path's case sensitivity, allowing for more precise control over the matching process.
813813

814+
platform
815+
--------
816+
817+
* Add support for detecting Windows 11 and Windows Server releases past 2012.
818+
Previously, lookups on Windows Server platforms newer than Windows Server 2012
819+
and on Windows 11 would return ``Windows-10``.
820+
(Contributed by Steve Dower in :gh:`89545`.)
821+
814822
pdb
815823
---
816824

Doc/whatsnew/3.14.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,9 @@ uuid
10171017
Nil and Max UUID formats as defined by :rfc:`9562`.
10181018
(Contributed by Nick Pope in :gh:`128427`.)
10191019

1020+
* Allow to generate multiple UUIDs at once via :option:`python -m uuid --count <uuid --count>`.
1021+
(Contributed by Simon Legner in :gh:`131236`.)
1022+
10201023

10211024
zipinfo
10221025
-------

Include/cpython/tupleobject.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
typedef struct {
66
PyObject_VAR_HEAD
7+
/* Cached hash. Initially set to -1. */
8+
Py_hash_t ob_hash;
79
/* ob_item contains space for 'ob_size' elements.
810
Items must normally not be NULL, except during construction when
911
the tuple is not yet visible outside the function that builds it. */

0 commit comments

Comments
 (0)