This is a follow up of GH-124974. Only Glibc needed a fix.
Now the returned value is a string consisting of semicolon-separated
symbols on all Posix platforms.
(cherry picked from commit dcc4fb2c90)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-123133: clarify p=0 case for "f" and "e" formatting types (GH-125426)
(cherry picked from commit cfc27bc50f)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-125289: Update sample code in asyncio-task.rst (GH-125292)
* Update sample code in asyncio-task.rst
This will change **coroutines** sample code in the **Awaitables** section and make the example clearer.
* Update Doc/library/asyncio-task.rst
Revert the added print
* Update Doc/library/asyncio-task.rst
---------
(cherry picked from commit fa52b82c91)
Co-authored-by: Ghorban M. Tavakoly <58617996+galmyk@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Fix typo in ``Doclibrary/functions.rst`` (GH-125327)
(cherry picked from commit 76b29d271b)
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
gh-125296: Fix strange fragment identifier for `name or flags` in argparse docs (GH-125297)
(cherry picked from commit c1913effee)
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
Returns a tuple of up to 100 strings for ALT_DIGITS lookup (an empty tuple on most locales).
Previously it returned the first item of that tuple or an empty string.
(cherry picked from commit 21c04e1a97)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Barry Warsaw <barry@python.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
The term "free variable" has unfortunately become genuinely
ambiguous over the years (presumably due to the names of
some relevant code object instance attributes).
While we can't eliminate that ambiguity at this late date, we can
at least alert people to the potential ambiguity by describing
both the formal meaning of the term and the common
alternative use as a direct synonym for "closure variable".
---------
(cherry picked from commit 27390990fa)
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
gh-125018: Add importlib.metadata semantic link targets (#125027)
This allows direct intersphinx references to APIs via references
like `` :func:`importlib.metadata.version` ``.
(cherry picked from commit cda3b5a576)
---------
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Substrings of the specified string no longer considered valid values.
(cherry picked from commit f1a2417b9e)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-125025: `_thread` docs: fix/update the *caveats* list (GH-125026)
(cherry picked from commit 1e098dc766)
Co-authored-by: Jan Kaliszewski <zuo@kaliszewski.net>
Highlight `datetime.timedelta.seconds` vs `.total_seconds()` in docs. (GH-124811)
Thanks to the reviewers for suggesting the use of a "caution" section instead of "warning" or "note".
(cherry picked from commit d150e4abcf)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Revert the incremental GC in 3.13, since it's not clear that without further turning, the benefits outweigh the costs.
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
docs: improve venv docs (GH-124540)
- Move "versionchanged" notes that apply to the whole class to the
end of the class docs
- Remove or move notes next to the method list that apply to individual
methods.
- Mark up parameters using the appropriate syntax
- Do not capitalize "boolean"
- Shorten some text
(cherry picked from commit c976d789a9)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
gh-90190: Add doc for using `singledispatch` with precise collection type hints (GH-116544)
(cherry picked from commit 2357d5ba48)
Co-authored-by: Matt Delengowski <matt.delengowski@gmail.com>
gh-119004: fix a crash in equality testing between `OrderedDict` (GH-121329)
(cherry picked from commit 38a887dc3e)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Docs: Update and proofread `library/venv.rst` (GH-124121)
(cherry picked from commit 23e812b84a)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-123560: Correct docs for "empty" format type for floats (GH-123561)
(cherry picked from commit 274d9ab619)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
gh-123445: calendar: Improve descriptions for day and month attributes (GH-123483)
(cherry picked from commit 8447c933da)
Co-authored-by: Mat S <mscull@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Doc: Improve documentation for the ``path`` argument in ``shutil.which()`` (GH-124494)
(cherry picked from commit 0d38409f42)
Co-authored-by: Tom Most <twm@freecog.net>
gh-65169: Clarify prog default in argparse (GH-31602)
(cherry picked from commit e69ff34e81)
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
gh-123789: `secrets.randbits` returns only non-negative int (GH-123801)
(cherry picked from commit beee91cdcc)
Co-authored-by: Wulian <1055917385@qq.com>
gh-123834: Add `symtable` to the list of modules with a CLI (GH-123835)
(cherry picked from commit 32bc2d6141)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-123905: Update TOML description to include version number (GH-123906)
Update TOML description to include version number
There is some movement, currently blocked, that would update the TOML spec to 1.1.0; this would include breaking changes to what characters are allowed. Thus, it is worthwhile for the library page to be clear which version is implemented here.
(cherry picked from commit 1b29f4144c)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Paul Hoffman <phoffman@proper.com>
gh-108951: Document how to terminate an asyncio.TaskGroup (GH-123837)
We don't want to add another API, since the recipe is straightforward and rarely needed.
The advantage is that we could backport this to the earliest Python version that has taskgroups (3.11, alas in security mode already, so we'll just do 3.12 and 3.13).
(cherry picked from commit ef05801ba0)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-121607: Edited source file import recipe to make it more clear (GH-121519)
(cherry picked from commit 38809171b8)
Co-authored-by: Chris Barker <Chris.Barker@noaa.gov>
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
gh-118577: Clarify that inspect.BoundArguments prefers to put values in args (GH-119936)
(cherry picked from commit 8e99495701)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
GH-79714: Add mention of stderr for clarity to ArgumentParser.exit() (GH-123932)
(cherry picked from commit 5f5c0b9c23)
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
Use pep role instead of url (GH-121611)
(cherry picked from commit 33eeccf6d4)
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
* [3.13] GH-109975: Copyedit 3.13 What's New: C API (GH-124313)
(cherry picked from commit 9d0a75269c)
* gh-118915: Add/fix docs entries for some new 3.13 C API (GH-124134)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Normalize cdecl formatting as found elsewhere on ctypes.rst (GH-121379)
(cherry picked from commit bbb36c0934)
Co-authored-by: utkonos <utkonos@users.noreply.github.com>
gh-123523: Rework typing documentation for generators and coroutines, and link to it from `collections.abc` docs (GH-123544)
(cherry picked from commit 56e4a417ce)
Co-authored-by: Stanislav Terliakov <50529348+sterliakov@users.noreply.github.com>
gh-118508: Clarify which characters are matched by `\s` (GH-119155)
Clarify re syntax
(cherry picked from commit 22fdb8cf89)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
gh-123570: Add link to `weakref.ref` from `weakref_slot` docs in `dataclasses` (GH-123571)
(cherry picked from commit c3ed775899)
Co-authored-by: sobolevn <mail@sobolevn.me>
gh-123213: Fixed xml.etree.ElementTree.Element.extend and assignment to no longer hide exceptions (GH-123214)
(cherry picked from commit 90b6d0e0f8)
Co-authored-by: Bar Harel <bharel@barharel.com>
gh-91126: Docs and tests for slotted dataclasses with `__init_subclass__` (GH-123342)
(cherry picked from commit 75e72822a3)
Co-authored-by: sobolevn <mail@sobolevn.me>
gh-123494: Improve documentation for ``webbrowser`` return types (GH-123495)
Document the return value for ``webbrowser.open*()``.
(cherry picked from commit 0b6acfee04)
Co-authored-by: Aarni Koskela <akx@iki.fi>
gh-82378: Document the difference between sys.tracebacklimit and the limit arguments (GH-123286)
(cherry picked from commit 70bfef52b5)
Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
gh-122982: Extend the deprecation period for bool inversion by two years (GH-123306)
(cherry picked from commit 249b083ed8)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
(cherry picked from commit 127660bcdb)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
gh-123110: correct note about _Bool in the struct module docs (GH-123111)
(cherry picked from commit b0f462d4c8)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
gh-123005: Add version added in enum.Flag.__len__ (GH-123007)
(cherry picked from commit 8e2dc7f380)
Co-authored-by: Damien <81557462+Damien-Chen@users.noreply.github.com>
Docs: Standardise versionchanged text in weakref.rst (GH-122898)
(cherry picked from commit db8b83c2b0)
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
GH-120794: Use example paths with multiple parts in pathlib docs (GH-122887)
In the documentation of `PosixPath` and `WindowsPath`, and their `Pure*`
equivalents, use example paths with multiple non-anchor parts.
(cherry picked from commit 363374cf69)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-105376: Restore deprecated logging warn() method (GH-122775)
This reverts commit dcc028d924 and
commit 6c54e5d721.
Keep the deprecated logging warn() method in Python 3.13.
(cherry picked from commit d3239976a8)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
gh-121103: Update site module docs for free-threaded installs (GH-122737)
(cherry picked from commit 1429651a06)
Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233)
GH-GH- Encode header parts that contain newlines
Per RFC 2047:
> [...] these encoding schemes allow the
> encoding of arbitrary octet values, mail readers that implement this
> decoding should also ensure that display of the decoded data on the
> recipient's terminal will not cause unwanted side-effects
It seems that the "quoted-word" scheme is a valid way to include
a newline character in a header value, just like we already allow
undecodable bytes or control characters.
They do need to be properly quoted when serialized to text, though.
GH-GH- Verify that email headers are well-formed
This should fail for custom fold() implementations that aren't careful
about newlines.
(cherry picked from commit 0976339818)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Bas Bloemsaat <bas@bloemsaat.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-105733: Soft-deprecate ctypes.ARRAY, rather than hard-deprecating it. (GH-122281)
Soft-deprecate ctypes.ARRAY, rather than hard-deprecating it.
Partially reverts 2211454fe2
(cherry picked from commit 3833d27f98)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Re-order table of corresponding functions with the following priorities:
1. Pure functionality is at the top
2. `os.path` functions are shown before `os` functions
3. Similar functionality is kept together
4. Functionality follows docs order where possible
Add a few missed correspondences:
- `os.path.isjunction` and `Path.is_junction`
- `os.path.ismount` and `Path.is_mount`
- `os.lstat()` and `Path.lstat()`
- `os.lchmod()` and `Path.lchmod()`
Also add footnotes describing a few differences.
(cherry picked from commit cbac8a3888)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
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>
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>
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>
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>
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>
* 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-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>
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>
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>