Docs: Use cross-reference to `os.uname` in `sysconfig.get_platform` (GH-122083)
(cherry picked from commit 498cb6dff1)
Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
Relatedly, emit the `cpython.run_startup` event from the Python version of
`PYTHONSTARTUP` handling.
(cherry picked from commit dc93d1125f)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Docs: spelling and grammar fixes (GH-122084)
Corrected some grammar and spelling issues in documentation.
(cherry picked from commit bc264eac3a)
Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-120522: Apply App Store compliance patch during installation (GH-121947)
Adds a --with-app-store-compliance configuration option that patches out code known to be an issue with App Store review processes. This option is applied automatically on iOS, and optionally on macOS.
(cherry picked from commit 728432c804)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Delete stale note about mp.Lock.acquire/SIGINT (GH-120929)
(cherry picked from commit 0dcbc83853)
Co-authored-by: Andrey Mishchenko <mishchea@gmail.com>
gh-121977: Add tips for handling unhashable data (GH-122075)
(cherry picked from commit ebc18abbf3)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
GH-121970: Modernise the patchlevel extension (GH-121995)
(cherry picked from commit b7ad711fcb)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Docs: Fix a typo in What's New in Python 3.13 (GH-122051)
(cherry picked from commit 3de092b82f)
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
This adds tests for the documented behaviour of `pkgutil.extend_path`
regarding different argument types as well as for `*.pkg` files.
(cherry picked from commit 8f2532168b)
Co-authored-by: Andreas Stocker <andreas@stocker.co.it>
This is not something we can do too much about, without help from the
underlying libraries.
(cherry picked from commit 709db44255)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
GH-121970: Use Ruff to check and format the docs tools (GH-122018)
(cherry picked from commit 40855f3ab8)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@gmail.com>
GH-121970: Combine custom Pygments lexers into a package (GH-121976)
(cherry picked from commit 7431c3799e)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
GH-121970: Make ``DeprecatedRemoved`` a subclass of ``VersionChange`` (GH-121971)
(cherry picked from commit 898e90c3be)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
GH-121970: Improve the glossary preview in HTML search (GH-121991)
(cherry picked from commit adf0b94d1c)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Docs: Upgrade Sphinx to 7.4 (GH-121987)
(cherry picked from commit 420d943128)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
GH-117928: Bump the minimum Sphinx version to 6.2.1 (GH-121986)
(cherry picked from commit 7dd52b63ce)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
GH-121970: Use ``SphinxDirective`` instead of ``Directive`` (GH-121972)
(cherry picked from commit ac39151a09)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Switch PyUnicode_InternInPlace to _PyUnicode_InternMortal, clarify docs
* Document immortality in some functions that take `const char *`
This is PyUnicode_InternFromString;
PyDict_SetItemString, PyObject_SetAttrString;
PyObject_DelAttrString; PyUnicode_InternFromString;
and the PyModule_Add convenience functions.
Always point out a non-immortalizing alternative.
* Don't immortalize user-provided attr names in _ctypes
(cherry picked from commit b4aedb23ae)
gh-121403: Add notes for PyList_GetXXX APIs about the need for init (gh-121626)
(cherry picked from commit 2bac2b86b1)
Co-authored-by: Donghee Na <donghee.na@python.org>
This reverts commit 0dfb437a32 prior
to the release of 3.13.0b4 to allow for additional review time.
(cherry picked from commit f27593a87c)
Co-authored-by: Ned Deily <nad@python.org>
gh-120831: Increase the default minimum supported iOS version to 13.0 (GH-121250)
Increases the default minimum iOS version to 13.0.
(cherry picked from commit 7e91e0dcfe)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
It is our general practice to make new optional parameters keyword-only,
even if the existing parameters are all positional-or-keyword. Passing
this parameter as positional would look confusing and could be error-prone
if additional parameters are added in the future.
(cherry picked from commit 50eec501fe)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
gh-73159 Added clarifications in multiprocessing docs on that objects are pickled. (GH-121686)
Added explicit comments about that objects are pickled when transmitted via multiprocessing queues and pipes.
(cherry picked from commit b5805892d5)
Co-authored-by: Ulrik Södergren <ulrik@digitalfotografen.se>
gh-121333: Clarify what is the default executor for asyncio.run_in_executor (GH-121335)
(cherry picked from commit facf9862da)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Update example of str.split, bytes.split (GH-121287)
In `{str,bytes}.strip(chars)`, multiple characters are not treated as a
prefix/suffix, but as individual characters. This may make users confuse
whether `split` has similar behavior.
Users may incorrectly expect that
`'Good morning, John.'.split(', .') == ['Good', 'morning', 'John']`
Adding a bit of clarification in the doc.
(cherry picked from commit 892e3a1b70)
Co-authored-by: Yuxin Wu <ppwwyyxxc@gmail.com>
Co-authored-by: Yuxin Wu <ppwwyyxx@users.noreply.github.com>
docs: Fix "Py_TPFLAGS_MANAGED_WEAKREF is set in tp_flags" (GH-112237)
(cherry picked from commit 4232976b02)
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
gh-114104: clarify asynchronous comprehension docs to match runtime behavior (GH-121175)
(cherry picked from commit 91313afdb3)
Co-authored-by: Danny Yang <yangdanny97@users.noreply.github.com>
gh-120522: Add a `--with-app-store-compliance` configure option to patch out problematic code (GH-120984)
* Add --app-store-compliance configuration option.
* Added blurb.
* Correct tab-vs-spaces formatting issue.
* Correct source file name in docs.
* Correct source code reference in Mac docs
* Only apply the patch forward, and ensure the working directory is correct.
* Make patching reslient to multiple builds.
* Documentation fixes found during review
* Documentation and configure.ac syntax improvements
* Regenerate configure script.
* Silence the patch echo output.
---------
(cherry picked from commit 48cd104b0c)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
GH-119054: Add alt text to pathlib inheritance diagram (GH-121158)
(cherry picked from commit 6b280a8498)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
GH-119054: Add "Expanding and resolving paths" section to pathlib docs. (GH-120970)
Add dedicated subsection for `home()`, `expanduser()`, `cwd()`,
`absolute()`, `resolve()` and `readlink()`. The position of this section
keeps all the `Path` constructors (`Path()`, `Path.from_uri()`,
`Path.home()` and `Path.cwd()`) near the top. Within the section, closely
related methods are kept adjacent. Specifically:
- `home()` and `expanduser()` (the former calls the latter)
- `cwd()` and `absolute()` (the former calls the latter)
- `absolute()` and `resolve()` (both make paths absolute)
- `resolve()` and `readlink()` (both read symlink targets)
- Ditto `cwd()` and `absolute()`
- Ditto `absolute()` and `resolve()`
The "Other methods" section is removed.
(cherry picked from commit d6d8707ff2)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
doc: Mention the missing reflected special methods for all binary operations (GH-119931)
(cherry picked from commit bf5e1065f4)
Co-authored-by: Paulo Freitas <me@paulofreitas.me>
* Move pprinter parameter descriptions to a table
* Make pprint doc with params markup
* Remove duplication of the parameters' description
---------
(cherry picked from commit 0890ad7c02)
Co-authored-by: Kerim Kabirov <the.privat33r+gh@pm.me>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
gh-120937: Reference weakref from the `__del__` documentation (GH-120940)
(cherry picked from commit 1c13b29d54)
Co-authored-by: chaen <christophe.haen@cern.ch>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
gh-120661: improve example for basic type hints (GH-120934)
(cherry picked from commit bb057ea107)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
PyDict_Next no longer locks the dictionary in the free-threaded build. Locking
around individual PyDict_Next calls is not sufficient because the function
returns borrowed references and because it allows concurrent modifications
during the iteraiton loop.
The internal locking also interferes with correct external synchronization
because it may suspend outer critical sections created by the caller.
(cherry picked from commit 375b723d58)
Co-authored-by: Sam Gross <colesbury@gmail.com>
- gh-119521: Rename IncompleteInputError to _IncompleteInputError and remove from public API/ABI (GH-119680)
(cherry picked from commit ce1064e4c9)
- gh-119521: Use `PyAPI_DATA`, not `extern`, for `_PyExc_IncompleteInputError` (GH-120955)
(cherry picked from commit ac61d58db0)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
docs: puremagic.what() as replacement for imghdr.what() (GH-120871)
(cherry picked from commit 22b8a35d6e)
Co-authored-by: Christian Clauss <cclauss@me.com>
gh-120896: Fix typo in version changed note of `urllib.parse.urlparse()` (GH-120898)
(cherry picked from commit b6fa8fe86a)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
This makes the following macros public as part of the non-limited C-API for
locking a single object or two objects at once.
* `Py_BEGIN_CRITICAL_SECTION(op)` / `Py_END_CRITICAL_SECTION()`
* `Py_BEGIN_CRITICAL_SECTION2(a, b)` / `Py_END_CRITICAL_SECTION2()`
The supporting functions and structs used by the macros are also exposed for
cases where C macros are not available.
(cherry picked from commit 8f17d69b7b)
gh-120773: document introspective attributes of an async generator object in the inspect module (GH-120778)
(cherry picked from commit 83d3d7aace)
Co-authored-by: blhsing <blhsing@gmail.com>
Update the documentation howto index page and group docs into 3 logical sections (GH-119366)
(cherry picked from commit a26d27e7ee)
Includes a follow-up fix to properly merge GH-119877:
* Add a link to free-threading HOWTO to the index (GH-120703)
(cherry picked from commit 45d5cab533)
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
gh-118820: Zero-valued flag enum has no name (GH-118848)
(cherry picked from commit ed5ae6c4d7)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-119960: Add information about regex flags in re module functions (GH-119978)
(cherry picked from commit a86e6255c3)
Co-authored-by: Awbert <119314310+SweetyAngel@users.noreply.github.com>
The `inspect.ismethoddescriptor()` function did not check for the lack of
`__delete__()` and, consequently, erroneously returned True when applied
to *data* descriptors with only `__get__()` and `__delete__()` defined.
(cherry picked from commit dacc5ac71a)
Co-authored-by: Jan Kaliszewski <zuo@kaliszewski.net>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>