From baf934e598428f7b67e5439bb2fddaf6582a05f9 Mon Sep 17 00:00:00 2001 From: Bhuvansh Date: Fri, 14 Aug 2026 08:22:51 +0000 Subject: [PATCH 1/3] gh-154753: Update references to moved files in the docs (#155553) Co-authored-by: Stan Ulbrych --- Doc/extending/extending.rst | 2 +- Doc/library/sys.rst | 2 +- Doc/using/android.rst | 10 +++++----- Doc/using/configure.rst | 2 +- Doc/using/ios.rst | 10 +++++----- InternalDocs/code_objects.md | 2 +- InternalDocs/jit.md | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index 23e0064c6c93609..6518e20cafbc9e7 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -1405,7 +1405,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 diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 9078af7cac78d61..6fe097407445e49 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1798,7 +1798,7 @@ 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 + :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 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 diff --git a/Doc/using/configure.rst b/Doc/using/configure.rst index 2c0d81d48007013..77fa3674494d004 100644 --- a/Doc/using/configure.rst +++ b/Doc/using/configure.rst @@ -1159,7 +1159,7 @@ See :source:`Mac/README.rst`. iOS Options ----------- -See :source:`iOS/README.rst`. +See :source:`Platforms/Apple/iOS/README.md`. .. option:: --enable-framework=INSTALLDIR 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`` diff --git a/InternalDocs/code_objects.md b/InternalDocs/code_objects.md index a91a7043c1b8d41..7df1fe9fc2e25db 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, diff --git a/InternalDocs/jit.md b/InternalDocs/jit.md index 095853807377a45..2f6d8c411bdb7d6 100644 --- a/InternalDocs/jit.md +++ b/InternalDocs/jit.md @@ -115,7 +115,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 5eb579d4a978b797a981654cedccfec1577161a1 Mon Sep 17 00:00:00 2001 From: Bhuvansh Kataria Date: Fri, 14 Aug 2026 20:05:30 +0000 Subject: [PATCH 2/3] gh-154753: revert Platforms path changes for backport --- Doc/using/android.rst | 10 +++++----- Doc/using/configure.rst | 2 +- Doc/using/ios.rst | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Doc/using/android.rst b/Doc/using/android.rst index 36d82c11d95307e..60a135693181412 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:`Platforms/Android/README.md`. The ``prefix`` directory will be created under + :source:`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 diff --git a/Doc/using/configure.rst b/Doc/using/configure.rst index 77fa3674494d004..2c0d81d48007013 100644 --- a/Doc/using/configure.rst +++ b/Doc/using/configure.rst @@ -1159,7 +1159,7 @@ See :source:`Mac/README.rst`. iOS Options ----------- -See :source:`Platforms/Apple/iOS/README.md`. +See :source:`iOS/README.rst`. .. option:: --enable-framework=INSTALLDIR diff --git a/Doc/using/ios.rst b/Doc/using/ios.rst index 31d9e2f2c816e73..fa85407bede7b0e 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:`Platforms/Apple/iOS/README.md` (in the CPython source distribution) for details on + :source:`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,11 +266,11 @@ 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:`Platforms/Apple/iOS/README.md` +After building or obtaining an iOS XCFramework (see :source:`Apple/iOS/README.md` for details), create a clone of the Python iOS testbed project. If you used the ``Platforms/Apple`` build script to build the XCframework, you can run: @@ -282,7 +282,7 @@ Or, if you've sourced your own XCframework, by running: .. code-block:: bash - $ python Platforms/Apple/testbed clone --platform iOS --framework --app --app app-testbed + $ python Apple/iOS/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 bd107a94d3a1af1971603c24618244236d5c4e9d Mon Sep 17 00:00:00 2001 From: Bhuvansh Kataria Date: Fri, 14 Aug 2026 20:09:36 +0000 Subject: [PATCH 3/3] gh-154753: fix remaining iOS path changes for backport --- Doc/using/ios.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/using/ios.rst b/Doc/using/ios.rst index fa85407bede7b0e..5e4033fb6cec7a0 100644 --- a/Doc/using/ios.rst +++ b/Doc/using/ios.rst @@ -272,7 +272,7 @@ 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` for details), create a clone of the Python iOS testbed project. If you used the -``Platforms/Apple`` build script to build the XCframework, you can run: +``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/iOS/testbed clone --platform iOS --framework --app --app app-testbed + $ python 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``