Skip to content

Commit c79d107

Browse files
authored
Merge branch 'main' into allow-double-quote-in-cookie-values
2 parents 6e3d1d7 + f06fcb7 commit c79d107

Some content is hidden

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

44 files changed

+902
-505
lines changed

.github/workflows/reusable-docs.yml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,6 @@ jobs:
7575
--fail-if-regression \
7676
--fail-if-improved \
7777
--fail-if-new-news-nit
78-
- name: 'Build EPUB documentation'
79-
continue-on-error: true
80-
run: |
81-
set -Eeuo pipefail
82-
make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet" epub
83-
pip install epubcheck
84-
epubcheck Doc/build/epub/Python.epub &> Doc/epubcheck.txt
85-
- name: 'Check for fatal errors in EPUB'
86-
if: github.event_name == 'pull_request'
87-
continue-on-error: true # until gh-136155 is fixed
88-
run: |
89-
python Doc/tools/check-epub.py
9078
9179
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
9280
doctest:
@@ -114,3 +102,30 @@ jobs:
114102
# Use "xvfb-run" since some doctest tests open GUI windows
115103
- name: 'Run documentation doctest'
116104
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="--fail-on-warning" doctest
105+
106+
check-epub:
107+
name: 'Check EPUB'
108+
runs-on: ubuntu-latest
109+
timeout-minutes: 30
110+
steps:
111+
- uses: actions/checkout@v4
112+
with:
113+
persist-credentials: false
114+
- name: 'Set up Python'
115+
uses: actions/setup-python@v5
116+
with:
117+
python-version: '3'
118+
cache: 'pip'
119+
cache-dependency-path: 'Doc/requirements.txt'
120+
- name: 'Install build dependencies'
121+
run: |
122+
make -C Doc/ venv
123+
python -m pip install epubcheck
124+
- name: 'Build EPUB documentation'
125+
run: make -C Doc/ PYTHON=../python epub
126+
- name: 'Run epubcheck'
127+
continue-on-error: true
128+
run: epubcheck Doc/build/epub/Python.epub &> Doc/epubcheck.txt
129+
- run: cat Doc/epubcheck.txt
130+
- name: 'Check for fatal errors in EPUB'
131+
run: python Doc/tools/check-epub.py

.well-known/funding-manifest-urls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://www.python.org/funding.json

Doc/library/difflib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,9 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
351351

352352
.. seealso::
353353

354-
`Pattern Matching: The Gestalt Approach <https://www.drdobbs.com/database/pattern-matching-the-gestalt-approach/184407970>`_
354+
`Pattern Matching: The Gestalt Approach <https://jacobfilipp.com/DrDobbs/articles/DDJ/1988/8807/8807c/8807c.htm>`_
355355
Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. This
356-
was published in `Dr. Dobb's Journal <https://www.drdobbs.com/>`_ in July, 1988.
356+
was published in Dr. Dobb's Journal in July, 1988.
357357

358358

359359
.. _sequence-matcher:

Doc/library/functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ are always available. They are listed here in alphabetical order.
15771577
``pow(base, exp) % mod``). The two-argument form ``pow(base, exp)`` is
15781578
equivalent to using the power operator: ``base**exp``.
15791579

1580-
The arguments must have numeric types. With mixed operand types, the
1580+
When arguments are builtin numeric types with mixed operand types, the
15811581
coercion rules for binary arithmetic operators apply. For :class:`int`
15821582
operands, the result has the same type as the operands (after coercion)
15831583
unless the second argument is negative; in that case, all arguments are

Doc/library/time.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ These constants are used as parameters for :func:`clock_getres` and
935935

936936
.. data:: CLOCK_TAI
937937

938-
`International Atomic Time <https://www.nist.gov/pml/time-and-frequency-division/nist-time-frequently-asked-questions-faq#tai>`_
938+
`International Atomic Time <https://www.nist.gov/pml/time-and-frequency-division/how-utcnist-related-coordinated-universal-time-utc-international>`_
939939

940940
The system must have a current leap second table in order for this to give
941941
the correct answer. PTP or NTP software can maintain a leap second table.

Doc/library/typing.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ provides backports of these new features to older versions of Python.
4545

4646
.. seealso::
4747

48-
`"Typing cheat sheet" <https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html>`_
48+
`Typing cheat sheet <https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html>`_
4949
A quick overview of type hints (hosted at the mypy docs)
5050

51-
"Type System Reference" section of `the mypy docs <https://mypy.readthedocs.io/en/stable/index.html>`_
51+
Type System Reference section of `the mypy docs <https://mypy.readthedocs.io/en/stable/index.html>`_
5252
The Python typing system is standardised via PEPs, so this reference
5353
should broadly apply to most Python type checkers. (Some parts may still
5454
be specific to mypy.)
5555

56-
`"Static Typing with Python" <https://typing.python.org/en/latest/>`_
56+
`Static Typing with Python <https://typing.python.org/en/latest/>`_
5757
Type-checker-agnostic documentation written by the community detailing
5858
type system features, useful typing related tools and typing best
5959
practices.
@@ -64,7 +64,7 @@ Specification for the Python Type System
6464
========================================
6565

6666
The canonical, up-to-date specification of the Python type system can be
67-
found at `"Specification for the Python type system" <https://typing.python.org/en/latest/spec/index.html>`_.
67+
found at `Specification for the Python type system <https://typing.python.org/en/latest/spec/index.html>`_.
6868

6969
.. _type-aliases:
7070

@@ -2573,7 +2573,7 @@ types.
25732573
at runtime as soon as the class has been created. Monkey-patching
25742574
attributes onto a runtime-checkable protocol will still work, but will
25752575
have no impact on :func:`isinstance` checks comparing objects to the
2576-
protocol. See :ref:`"What's new in Python 3.12" <whatsnew-typing-py312>`
2576+
protocol. See :ref:`What's new in Python 3.12 <whatsnew-typing-py312>`
25772577
for more details.
25782578

25792579

Doc/library/warnings.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ Available Functions
458458
lower.one_way(**kw)
459459

460460
This makes the warning refer to both the ``example.lower.one_way()`` and
461-
``package.higher.another_way()`` call sites only from calling code living
461+
``example.higher.another_way()`` call sites only from calling code living
462462
outside of ``example`` package.
463463

464464
*source*, if supplied, is the destroyed object which emitted a

Doc/reference/compound_stmts.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ have ambiguous semantics.
386386

387387
It is not possible to mix :keyword:`except` and :keyword:`!except*`
388388
in the same :keyword:`try`.
389-
:keyword:`break`, :keyword:`continue` and :keyword:`return`
389+
The :keyword:`break`, :keyword:`continue`, and :keyword:`return` statements
390390
cannot appear in an :keyword:`!except*` clause.
391391

392392

Doc/tools/check-epub.py

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1-
import sys
21
from pathlib import Path
32

3+
CPYTHON_ROOT = Path(
4+
__file__, # cpython/Doc/tools/check-epub.py
5+
'..', # cpython/Doc/tools
6+
'..', # cpython/Doc
7+
'..', # cpython
8+
).resolve()
9+
EPUBCHECK_PATH = CPYTHON_ROOT / 'Doc' / 'epubcheck.txt'
410

5-
def main() -> int:
6-
wrong_directory_msg = "Must run this script from the repo root"
7-
if not Path("Doc").exists() or not Path("Doc").is_dir():
8-
raise RuntimeError(wrong_directory_msg)
9-
10-
with Path("Doc/epubcheck.txt").open(encoding="UTF-8") as f:
11-
messages = [message.split(" - ") for message in f.read().splitlines()]
1211

13-
fatal_errors = [message for message in messages if message[0] == "FATAL"]
12+
def main() -> int:
13+
lines = EPUBCHECK_PATH.read_text(encoding='utf-8').splitlines()
14+
fatal_errors = [line for line in lines if line.startswith('FATAL')]
1415

1516
if fatal_errors:
16-
print("\nError: must not contain fatal errors:\n")
17-
for error in fatal_errors:
18-
print(" - ".join(error))
17+
err_count = len(fatal_errors)
18+
s = 's' * (err_count != 1)
19+
print()
20+
print(f'Error: epubcheck reported {err_count} fatal error{s}:')
21+
print()
22+
print('\n'.join(fatal_errors))
23+
return 1
1924

20-
return len(fatal_errors)
25+
print('Success: no fatal errors found.')
26+
return 0
2127

2228

23-
if __name__ == "__main__":
24-
sys.exit(main())
29+
if __name__ == '__main__':
30+
raise SystemExit(main())

Include/internal/pycore_interp_structs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ struct _ceval_runtime_state {
8888
struct trampoline_api_st trampoline_api;
8989
FILE *map_file;
9090
Py_ssize_t persist_after_fork;
91+
_PyFrameEvalFunction prev_eval_frame;
9192
#else
9293
int _not_used;
9394
#endif

0 commit comments

Comments
 (0)