From 22afcc5ca8538a97b5174e3a6330b9f4dd03c173 Mon Sep 17 00:00:00 2001 From: Zayan Khan Date: Sun, 26 Jul 2026 18:28:28 -0400 Subject: [PATCH 1/7] Docs: fix Android paths after move to Platforms/Android The Android build tooling moved from Android/ to Platforms/Android/ in gh-146445, but the five :source: references in Doc/using/android.rst still point at the old location and render as broken GitHub links. Co-Authored-By: Claude Fable 5 --- Doc/using/android.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/using/android.rst b/Doc/using/android.rst index 60a135693181412..36d82c11d95307e 100644 --- a/Doc/using/android.rst +++ b/Doc/using/android.rst @@ -37,7 +37,7 @@ much easier experience: * `Termux `__ If you're sure you want to do all of this manually, read on. You can use the -:source:`testbed app ` as a guide; each step below contains a +:source:`testbed app ` as a guide; each step below contains a link to the relevant file. * First, acquire a build of Python for Android: @@ -47,10 +47,10 @@ link to the relevant file. mentioned below is at the top level of the package. * Or if you want to build it yourself, follow the instructions in - :source:`Android/README.md`. The ``prefix`` directory will be created under + :source:`Platforms/Android/README.md`. The ``prefix`` directory will be created under :samp:`cross-build/{HOST}`. -* Add code to your :source:`build.gradle ` +* Add code to your :source:`build.gradle ` file to copy the following items into your project. All except your own Python code can be copied from ``prefix/lib``: @@ -65,10 +65,10 @@ link to the relevant file. * ``python*.*/site-packages`` (your own Python code) * Add code to your app to :source:`extract the assets to the filesystem - `. + `. * Add code to your app to :source:`start Python in embedded mode - `. This will need to be C code + `. This will need to be C code called via JNI. Building a Python package for Android From 2170dc781217415f8eb1c5ceeee765b6073be4dd Mon Sep 17 00:00:00 2001 From: Zayan Khan Date: Sun, 26 Jul 2026 18:28:41 -0400 Subject: [PATCH 2/7] Docs: fix iOS paths after move to Platforms/Apple The iOS build tooling moved to Platforms/Apple in gh-146445, with the shared testbed now at Platforms/Apple/testbed rather than under iOS/. Update the :source: references and the example testbed invocation to match (the invocation upstream README uses at Platforms/Apple/iOS/README.md). Co-Authored-By: Claude Fable 5 --- Doc/using/ios.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/using/ios.rst b/Doc/using/ios.rst index 5e4033fb6cec7a0..31d9e2f2c816e73 100644 --- a/Doc/using/ios.rst +++ b/Doc/using/ios.rst @@ -170,7 +170,7 @@ helpful. To add Python to an iOS Xcode project: 1. Build or obtain a Python ``XCFramework``. See the instructions in - :source:`Apple/iOS/README.md` (in the CPython source distribution) for details on + :source:`Platforms/Apple/iOS/README.md` (in the CPython source distribution) for details on how to build a Python ``XCFramework``. At a minimum, you will need a build that supports ``arm64-apple-ios``, plus one of either ``arm64-apple-ios-simulator`` or ``x86_64-apple-ios-simulator``. @@ -266,13 +266,13 @@ modules in your app, some additional steps will be required: Testing a Python package ------------------------ -The CPython source tree contains :source:`a testbed project ` that +The CPython source tree contains :source:`a testbed project ` that is used to run the CPython test suite on the iOS simulator. This testbed can also be used as a testbed project for running your Python library's test suite on iOS. -After building or obtaining an iOS XCFramework (see :source:`Apple/iOS/README.md` +After building or obtaining an iOS XCFramework (see :source:`Platforms/Apple/iOS/README.md` for details), create a clone of the Python iOS testbed project. If you used the -``Apple`` build script to build the XCframework, you can run: +``Platforms/Apple`` build script to build the XCframework, you can run: .. code-block:: bash @@ -282,7 +282,7 @@ Or, if you've sourced your own XCframework, by running: .. code-block:: bash - $ python Apple/testbed clone --platform iOS --framework --app --app app-testbed + $ python Platforms/Apple/testbed clone --platform iOS --framework --app --app app-testbed Any folders specified with the ``--app`` flag will be copied into the cloned testbed project. The resulting testbed will be created in the ``app-testbed`` From c1cdc9b0b410be2b5b078184cd954c1388f0daea Mon Sep 17 00:00:00 2001 From: Zayan Khan Date: Sun, 26 Jul 2026 18:29:22 -0400 Subject: [PATCH 3/7] Docs: fix iOS README reference in configure docs iOS/README.rst moved to Platforms/Apple/iOS/README.md (and became Markdown along the way); the old :source: reference renders as a broken GitHub link. Co-Authored-By: Claude Fable 5 --- Doc/using/configure.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/using/configure.rst b/Doc/using/configure.rst index fd20ff2cb898107..28edf0408fd36e8 100644 --- a/Doc/using/configure.rst +++ b/Doc/using/configure.rst @@ -1275,7 +1275,7 @@ See :source:`Mac/README.rst`. iOS Options ----------- -See :source:`iOS/README.rst`. +See :source:`Platforms/Apple/iOS/README.md`. .. option:: --enable-framework=INSTALLDIR From f0b77b35ec8dd711a70a9b4b13a70ea830b25c44 Mon Sep 17 00:00:00 2001 From: Zayan Khan Date: Sun, 26 Jul 2026 18:29:22 -0400 Subject: [PATCH 4/7] Docs: fix reference to Objects/capsule.c in extending docs The Capsule implementation lives in Objects/capsule.c; there is no Objects/pycapsule.c (the header half of the sentence is correct). Co-Authored-By: Claude Fable 5 --- Doc/extending/extending.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index 110dfea8cb98abe..6a807085cc328f0 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -1106,7 +1106,7 @@ Finally it should be mentioned that Capsules offer additional functionality, which is especially useful for memory allocation and deallocation of the pointer stored in a Capsule. The details are described in the Python/C API Reference Manual in the section :ref:`capsules` and in the implementation of Capsules (files -:file:`Include/pycapsule.h` and :file:`Objects/pycapsule.c` in the Python source +:file:`Include/pycapsule.h` and :file:`Objects/capsule.c` in the Python source code distribution). .. rubric:: Footnotes From 49849053b2d34c13fac68c2d204cbdec122b9e9a Mon Sep 17 00:00:00 2001 From: Zayan Khan Date: Sun, 26 Jul 2026 18:29:22 -0400 Subject: [PATCH 5/7] Docs: replace removed Objects/lnotab_notes.txt reference in sys docs lnotab_notes.txt was removed in gh-134690 with the last co_lnotab support. The line-number/locations table is now documented in InternalDocs/code_objects.md. Co-Authored-By: Claude Fable 5 --- Doc/library/sys.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 355621db2e18a18..4d4a02453ba636f 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1941,8 +1941,8 @@ always available. Unless explicitly noted otherwise, all variables are read-only The interpreter is about to execute a new line of code or re-execute the condition of a loop. The local trace function is called; *arg* is ``None``; the return value specifies the new local trace function. See - :file:`Objects/lnotab_notes.txt` for a detailed explanation of how this - works. + :source:`InternalDocs/code_objects.md` for a detailed explanation of how + this works. Per-line events may be disabled for a frame by setting :attr:`~frame.f_trace_lines` to :const:`False` on that :ref:`frame `. From 3a8c937daa1eaf05714e27bbe9e6f365601cac44 Mon Sep 17 00:00:00 2001 From: Zayan Khan Date: Sun, 26 Jul 2026 18:29:22 -0400 Subject: [PATCH 6/7] InternalDocs: do not link generated jit_stencils.h jit_stencils.h is a gitignored build artifact, so the relative link 404s on GitHub. Co-Authored-By: Claude Fable 5 --- InternalDocs/jit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InternalDocs/jit.md b/InternalDocs/jit.md index 1345f2db8b34db9..8db5ba3c85ddda6 100644 --- a/InternalDocs/jit.md +++ b/InternalDocs/jit.md @@ -140,7 +140,7 @@ template file [`Tools/jit/template.c`](../Tools/jit/template.c). Each of the `.c` files is compiled by LLVM, to produce an object file that contains a function that executes the opcode. These compiled functions are used to generate the file -[`jit_stencils.h`](../jit_stencils.h), which contains the functions +`jit_stencils.h`, which contains the functions that the JIT can use to emit code for each of the bytecodes. For Python maintainers this means that changes to the bytecodes and From 89cfae15e9a908c0ecb8dbc463a58734d8123f34 Mon Sep 17 00:00:00 2001 From: Zayan Khan Date: Sun, 26 Jul 2026 18:29:22 -0400 Subject: [PATCH 7/7] InternalDocs: fix inverted Markdown link syntax in code_objects.md (text)[url] does not render as a link. Co-Authored-By: Claude Fable 5 --- InternalDocs/code_objects.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InternalDocs/code_objects.md b/InternalDocs/code_objects.md index cccbe71588622cf..98fa22d66a923c2 100644 --- a/InternalDocs/code_objects.md +++ b/InternalDocs/code_objects.md @@ -48,7 +48,7 @@ Note that traceback objects don't store all this information -- they store the s number, for backward compatibility, and the "last instruction" value. The rest can be computed from the last instruction (`tb_lasti`) with the help of the locations table. For Python code, there is a convenience method -(`codeobject.co_positions`)[https://docs.python.org/dev/reference/datamodel.html#codeobject.co_positions] +[`codeobject.co_positions`](https://docs.python.org/dev/reference/datamodel.html#codeobject.co_positions) which returns an iterator of `({line}, {endline}, {column}, {endcolumn})` tuples, one per instruction. There is also `co_lines()` which returns an iterator of `({start}, {end}, {line})` tuples,