Skip to content

Commit f5be5e0

Browse files
Merge branch 'main' into docs-fix-pythondontwritebytecode
2 parents 22afe2b + 1e17ccd commit f5be5e0

File tree

149 files changed

+11008
-2590
lines changed

Some content is hidden

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

149 files changed

+11008
-2590
lines changed

.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ Include/opcode.h generated
8383
Include/opcode_ids.h generated
8484
Include/token.h generated
8585
Lib/_opcode_metadata.py generated
86-
Lib/keyword.py generated
8786
Lib/idlelib/help.html generated
87+
Lib/keyword.py generated
88+
Lib/pydoc_data/topics.py generated
89+
Lib/pydoc_data/module_docs.py generated
8890
Lib/test/certdata/*.pem generated
8991
Lib/test/certdata/*.0 generated
9092
Lib/test/levenshtein_examples.json generated

.github/workflows/tail-call.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,26 +79,25 @@ jobs:
7979
with:
8080
python-version: '3.11'
8181

82-
- name: Native Windows (debug)
82+
- name: Native Windows MSVC (release)
8383
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
84-
shell: cmd
84+
shell: pwsh
8585
run: |
86-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
87-
set PlatformToolset=clangcl
88-
set LLVMToolsVersion=${{ matrix.llvm }}.1.0
89-
set LLVMInstallDir=C:\Program Files\LLVM
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
86+
choco install visualstudio2026buildtools --no-progress -y --force --params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --locale en-US --passive"
87+
$env:PATH = "C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\MSBuild\Current\bin;$env:PATH"
88+
$env:PlatformToolset = "v145"
89+
./PCbuild/build.bat --tail-call-interp -c Release -p ${{ matrix.architecture }}
90+
./PCbuild/rt.bat -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
9291
9392
# No tests (yet):
94-
- name: Emulated Windows (release)
93+
- name: Emulated Windows Clang (release)
9594
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
96-
shell: cmd
95+
shell: pwsh
9796
run: |
9897
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
99-
set PlatformToolset=clangcl
100-
set LLVMToolsVersion=${{ matrix.llvm }}.1.0
101-
set LLVMInstallDir=C:\Program Files\LLVM
98+
$env:PlatformToolset = "clangcl"
99+
$env:LLVMToolsVersion = "${{ matrix.llvm }}.1.0"
100+
$env:LLVMInstallDir = "C:\Program Files\LLVM"
102101
./PCbuild/build.bat --tail-call-interp -p ${{ matrix.architecture }}
103102
104103
- name: Native macOS (release)

.pre-commit-config.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.13.2
3+
rev: v0.14.10
44
hooks:
55
- id: ruff-check
66
name: Run Ruff (lint) on Apple/
@@ -40,19 +40,19 @@ repos:
4040
files: ^Apple
4141
- id: ruff-format
4242
name: Run Ruff (format) on Doc/
43-
args: [--check]
43+
args: [--exit-non-zero-on-fix]
4444
files: ^Doc/
4545
- id: ruff-format
4646
name: Run Ruff (format) on Tools/build/check_warnings.py
47-
args: [--check, --config=Tools/build/.ruff.toml]
47+
args: [--exit-non-zero-on-fix, --config=Tools/build/.ruff.toml]
4848
files: ^Tools/build/check_warnings.py
4949
- id: ruff-format
5050
name: Run Ruff (format) on Tools/wasm/
51-
args: [--check, --config=Tools/wasm/.ruff.toml]
51+
args: [--exit-non-zero-on-fix, --config=Tools/wasm/.ruff.toml]
5252
files: ^Tools/wasm/
5353

5454
- repo: https://github.com/psf/black-pre-commit-mirror
55-
rev: 25.9.0
55+
rev: 25.12.0
5656
hooks:
5757
- id: black
5858
name: Run Black on Tools/jit/
@@ -83,24 +83,24 @@ repos:
8383
files: '^\.github/CODEOWNERS|\.(gram)$'
8484

8585
- repo: https://github.com/python-jsonschema/check-jsonschema
86-
rev: 0.34.0
86+
rev: 0.36.0
8787
hooks:
8888
- id: check-dependabot
8989
- id: check-github-workflows
9090
- id: check-readthedocs
9191

9292
- repo: https://github.com/rhysd/actionlint
93-
rev: v1.7.7
93+
rev: v1.7.9
9494
hooks:
9595
- id: actionlint
9696

9797
- repo: https://github.com/woodruffw/zizmor-pre-commit
98-
rev: v1.14.1
98+
rev: v1.19.0
9999
hooks:
100100
- id: zizmor
101101

102102
- repo: https://github.com/sphinx-contrib/sphinx-lint
103-
rev: v1.0.0
103+
rev: v1.0.2
104104
hooks:
105105
- id: sphinx-lint
106106
args: [--enable=default-role]

Doc/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ doctest:
140140
pydoc-topics: BUILDER = pydoc-topics
141141
pydoc-topics: build
142142
@echo "Building finished; now run this:" \
143-
"cp build/pydoc-topics/topics.py ../Lib/pydoc_data/topics.py"
143+
"cp build/pydoc-topics/topics.py ../Lib/pydoc_data/topics.py" \
144+
"&& cp build/pydoc-topics/module_docs.py ../Lib/pydoc_data/module_docs.py"
144145

145146
.PHONY: gettext
146147
gettext: BUILDER = gettext

Doc/deprecations/pending-removal-in-3.15.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,6 @@ Pending removal in Python 3.15
3333

3434
* ``load_module()`` method: use ``exec_module()`` instead.
3535

36-
* :class:`locale`:
37-
38-
* The :func:`~locale.getdefaultlocale` function
39-
has been deprecated since Python 3.11.
40-
Its removal was originally planned for Python 3.13 (:gh:`90817`),
41-
but has been postponed to Python 3.15.
42-
Use :func:`~locale.getlocale`, :func:`~locale.setlocale`,
43-
and :func:`~locale.getencoding` instead.
44-
(Contributed by Hugo van Kemenade in :gh:`111187`.)
45-
4636
* :mod:`pathlib`:
4737

4838
* :meth:`!.PurePath.is_reserved`

Doc/library/datetime.rst

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2651,9 +2651,42 @@ Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's
26512651
``time.strftime(fmt, d.timetuple())`` although not all objects support a
26522652
:meth:`~date.timetuple` method.
26532653

2654-
For the :meth:`.datetime.strptime` class method, the default value is
2655-
``1900-01-01T00:00:00.000``: any components not specified in the format string
2656-
will be pulled from the default value. [#]_
2654+
For the :meth:`.datetime.strptime` and :meth:`.date.strptime` class methods,
2655+
the default value is ``1900-01-01T00:00:00.000``: any components not specified
2656+
in the format string will be pulled from the default value.
2657+
2658+
.. note::
2659+
When used to parse partial dates lacking a year, :meth:`.datetime.strptime`
2660+
and :meth:`.date.strptime` will raise when encountering February 29 because
2661+
the default year of 1900 is *not* a leap year. Always add a default leap
2662+
year to partial date strings before parsing.
2663+
2664+
2665+
.. testsetup::
2666+
2667+
# doctest seems to turn the warning into an error which makes it
2668+
# show up and require matching and prevents the actual interesting
2669+
# exception from being raised.
2670+
# Manually apply the catch_warnings context manager
2671+
import warnings
2672+
catch_warnings = warnings.catch_warnings()
2673+
catch_warnings.__enter__()
2674+
warnings.simplefilter("ignore")
2675+
2676+
.. testcleanup::
2677+
2678+
catch_warnings.__exit__()
2679+
2680+
.. doctest::
2681+
2682+
>>> from datetime import datetime
2683+
>>> value = "2/29"
2684+
>>> datetime.strptime(value, "%m/%d")
2685+
Traceback (most recent call last):
2686+
...
2687+
ValueError: day 29 must be in range 1..28 for month 2 in year 1900
2688+
>>> datetime.strptime(f"1904 {value}", "%Y %m/%d")
2689+
datetime.datetime(1904, 2, 29, 0, 0)
26572690

26582691
Using ``datetime.strptime(date_string, format)`` is equivalent to::
26592692

@@ -2790,7 +2823,7 @@ Notes:
27902823
include a year in the format. If the value you need to parse lacks a year,
27912824
append an explicit dummy leap year. Otherwise your code will raise an
27922825
exception when it encounters leap day because the default year used by the
2793-
parser is not a leap year. Users run into this bug every four years...
2826+
parser (1900) is not a leap year. Users run into that bug every leap year.
27942827

27952828
.. doctest::
27962829

@@ -2817,5 +2850,3 @@ Notes:
28172850
.. [#] See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar
28182851
<https://web.archive.org/web/20220531051136/https://webspace.science.uu.nl/~gent0113/calendar/isocalendar.htm>`_
28192852
for a good explanation.
2820-
2821-
.. [#] Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since 1900 is not a leap year.

Doc/library/locale.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,6 @@ The :mod:`locale` module defines the following exception and functions:
370370
determined.
371371
The "C" locale is represented as ``(None, None)``.
372372

373-
.. deprecated-removed:: 3.11 3.15
374-
375373

376374
.. function:: getlocale(category=LC_CTYPE)
377375

Doc/library/pdb.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,8 @@ can be overridden by the local file.
520520
To remove all commands from a breakpoint, type ``commands`` and follow it
521521
immediately with ``end``; that is, give no commands.
522522

523-
With no *bpnumber* argument, ``commands`` refers to the last breakpoint set.
523+
With no *bpnumber* argument, ``commands`` refers to the most recently set
524+
breakpoint that still exists.
524525

525526
You can use breakpoint commands to start your program up again. Simply use
526527
the :pdbcmd:`continue` command, or :pdbcmd:`step`,

0 commit comments

Comments
 (0)