Commit graph

28620 commits

Author SHA1 Message Date
Peter Bierma
bcdd10d0c8
[3.13] gh-127791: Fix, document, and test PyUnstable_AtExit (GH-127793) (#127819)
* Fix merge conflicts.

* [3.13] gh-127791: Fix, document, and test `PyUnstable_AtExit` (GH-127793)
(cherry picked from commit d5d84c3f13)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-12-11 13:40:45 +00:00
Miss Islington (bot)
8b28dedc58
[3.13] gh-126821: Add versionadded annotation to use_system_logger feature. (GH-127755) (#127806)
Add versionadded annotation to use_system_logger feature.
(cherry picked from commit 51216857ca)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2024-12-10 21:38:12 +00:00
Miss Islington (bot)
c6c9ff56a5
[3.13] Docs: Fix indents in xmlrpc.client.rst (GH-127782) (#127799)
Docs: Fix indents in `xmlrpc.client.rst` (GH-127782)
(cherry picked from commit 035f512046)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2024-12-10 17:41:01 +00:00
Miss Islington (bot)
00d60623e9
[3.13] gh-101100: Fix sphinx warnings in whatsnew/3.0.rst (GH-127662) (#127783)
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-12-10 10:45:30 +00:00
Russell Keith-Magee
075c41d5f5
[3.13] gh-126925: Modify how iOS test results are gathered (GH-127592) (#127754)
Adds a `use_system_log` config item to enable stdout/stderr redirection for
Apple platforms. This log streaming is then used by a new iOS test runner
script, allowing the display of test suite output at runtime. The iOS test
runner script can be used by any Python project, not just the CPython test
suite.
(cherry picked from commit 2041a95e68)
2024-12-09 14:39:11 +08:00
Miss Islington (bot)
5d35d279a5
[3.13] gh-101100: amend references starting with !~ in gh-127054 (GH-127684) (#127692)
gh-101100: amend references starting with `!~` in gh-127054 (GH-127684)
(cherry picked from commit 77a61c0465)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2024-12-06 14:19:08 +00:00
Miss Islington (bot)
304111e967
[3.13] [Docs] GDB howto: Fix block type of a cast example (GH-127621) (#127653)
[Docs] GDB howto: Fix block type of a cast example (GH-127621)
(cherry picked from commit 657d0e99aa)

Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
2024-12-05 20:58:36 +00:00
Miss Islington (bot)
a1c52d1265
[3.13] gh-127347: Document traceback.print_list (GH-127348) (#127569)
Add an documentation entry about `traceback.print_list`

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2024-12-04 10:28:14 +02:00
Miss Islington (bot)
bb46b74d9d
[3.13] Itertool recipe additions (gh-127483) (gh-127585) 2024-12-03 18:34:42 -06:00
Thomas Wouters
0671451779 Python 3.13.1 2024-12-03 18:59:52 +01:00
Miss Islington (bot)
3479a719b8
[3.13] gh-127253: Note that Stable ABI is about ABI stability (GH-127254) (GH-127557)
(cherry picked from commit 35d37d6592)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-12-03 13:57:42 +01:00
Eric Snow
219b8266db
[3.13] gh-126914: Store the Preallocated Thread State's Pointer in a PyInterpreterState Field (gh-127114)
This approach eliminates the originally reported race.  It also gets rid of the deadlock reported in gh-96071, so we can remove the workaround added then.

This is mostly a cherry-pick of 1c0a104 (AKA gh-126989).  The difference is we add PyInterpreterState.threads_preallocated at the end of PyInterpreterState, instead of adding PyInterpreterState.threads.preallocated.  That avoids ABI disruption.
2024-12-02 18:41:57 +00:00
Carol Willing
2d458b16e6
[3.13] gh-126720: Docs: Miscellaneous corrections to simple statements in the language reference (GH-126720) (#126885)
Docs: Miscellaneous corrections to simple statements in the language reference (GH-126720)

* Replace: The :keyword:`global` -> The :keyword:`global` statement
Add :keyword: when it's needed

* Replace repeated links with duoble backticks

(cherry picked from commit 94a7a4e22f)

Co-authored-by: Beomsoo Kim <beoms424@gmail.com>
2024-12-02 15:10:59 +01:00
Miss Islington (bot)
d9bbb52c7e
[3.13] gh-122838: Document missing opcodes (GH-123073) (#126492)
gh-122838: Document missing opcodes (GH-123073)
(cherry picked from commit 9cba47d9f1)

Co-authored-by: Kamil Turek <kamil.turek@hotmail.com>
2024-12-02 15:07:38 +01:00
Miss Islington (bot)
23ab1f9ff1
[3.13] gh-99880: document rounding mode for new-style formatting (GH-121481) (#126334)
The CPython uses _Py_dg_dtoa(), which does rounding to nearest with half
to even tie-breaking rule.

If that functions is unavailable, PyOS_double_to_string() fallbacks to
system snprintf().  Since CPython 3.12, build requirements include C11
compiler *and* support for IEEE 754 floating point numbers (Annex F).
This means that FE_TONEAREST macro is available and, per default,
printf-like functions should use same rounding mode as _Py_dg_dtoa().

(cherry picked from commit 7d7d56d8b1)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-12-02 15:05:13 +01:00
Miss Islington (bot)
26f1e88aae
[3.13] gh-101100: Fix Sphinx warnings about list methods (GH-127054) (#127511)
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2024-12-02 13:57:40 +00:00
Miss Islington (bot)
585d48f001
[3.13] gh-127443: Fix some entries in Doc/data/refcounts.dat (GH-127451) (#127496)
gh-127443: Fix some entries in `Doc/data/refcounts.dat` (GH-127451)

Fix incorrect entries in `Doc/data/refcounts.dat`
(cherry picked from commit 1f8267b85d)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-12-02 08:28:15 +00:00
Miss Islington (bot)
3b31f8c7e8
[3.13] gh-127356: Fix prepend doctrees directory for gettext target (GH-127357) (#127470)
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-12-01 09:21:34 +00:00
Yuki Kobayashi
a2814b984e
[3.13] Docs: Fix incorrect indents in c-api/type.rst (GH-127449) (#127460)
(cherry picked from commit 33ce8dcf79)
2024-12-01 10:50:51 +02:00
Miss Islington (bot)
4cba0e66c2
[3.13] gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) (#127390)
gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304)

---------

(cherry picked from commit dd3a87d2a8)

Co-authored-by: Илья Любавский <100635212+lubaskinc0de@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-11-30 08:13:13 +00:00
Miss Islington (bot)
ee57221872
[3.13] Link to correct class methods in asyncio primitives docs (GH-127270) (#127423)
Link to correct class methods in asyncio primitives docs (GH-127270)
(cherry picked from commit 15d6506d17)

Co-authored-by: Ollanta Cuba Gyllensten <ollantaster@gmail.com>
2024-11-29 16:26:42 +00:00
Miss Islington (bot)
92d14b7fab
[3.13] fix param type in PyObject_HasAttrWithError (docs) (GH-127403) (#127404)
fix param type in PyObject_HasAttrWithError (docs) (GH-127403)
(cherry picked from commit 3afb639f39)

Co-authored-by: biggus-developerus <74741815+biggus-developerus@users.noreply.github.com>
2024-11-29 10:59:13 +00:00
Miss Islington (bot)
d5a08f0ecb
[3.13] Fix indentation for contextlib.asynccontextmanager docs (GH-127333) (#127334)
Fix indentation for contextlib.asynccontextmanager docs (GH-127333)
(cherry picked from commit 9328db7652)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-11-27 14:45:07 +00:00
Miss Islington (bot)
8b2e30390c
[3.13] gh-101100: Fix sphinx warnings in howto/* (GH-127084) (#127287)
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2024-11-26 08:27:25 +00:00
Miss Islington (bot)
7f263d4444
[3.13] gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127269)
(cherry picked from commit 26ff32b305)

Co-authored-by: funkyrailroad <funkyrailroad@users.noreply.github.com>
2024-11-25 21:39:59 +00:00
Yuki Kobayashi
56933198cc
[3.13] gh-101100: Fix sphinx warnings of removed opcodes (GH-127222) (#127239) 2024-11-25 10:50:48 +02:00
Miss Islington (bot)
a6e61fd9d8
[3.13] Improve pathname2url() and url2pathname() docs (GH-127125) (#127232)
Improve `pathname2url()` and `url2pathname()` docs (GH-127125)

These functions have long sown confusion among Python developers. The
existing documentation says they deal with URL path components, but that
doesn't fit the evidence on Windows:

    >>> pathname2url(r'C:\foo')
    '///C:/foo'
    >>> pathname2url(r'\\server\share')
    '////server/share'  # or '//server/share' as of quite recently

If these were URL path components, they would imply complete URLs like
`file://///C:/foo` and `file://////server/share`. Clearly this isn't right.
Yet the implementation in `nturl2path` is deliberate, and the
`url2pathname()` function correctly inverts it.

On non-Windows platforms, the behaviour until quite recently is to simply
quote/unquote the path without adding or removing any leading slashes. This
behaviour is compatible with *both* interpretations -- 1) the value is a
URL path component (existing docs), and 2) the value is everything
following `file:` (this commit)

The conclusion I draw is that these functions operate on everything after
the `file:` prefix, which may include an authority section. This is the
only explanation that fits both the  Windows and non-Windows behaviour.
It's also a better match for the function names.
(cherry picked from commit 307c633586)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2024-11-24 17:46:54 +00:00
Miss Islington (bot)
cb270e96af
[3.13] Fix macro expansions in critical section docs (GH-127226) (#127229)
(cherry picked from commit 2bb7846cac)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
2024-11-24 17:26:40 +00:00
Miss Islington (bot)
a8e69fc68d
[3.13] gh-126896: Fix docs about asyncio.start_server() (GH-126897) (GH-126934)
gh-126896: Fix docs about `asyncio.start_server()` (GH-126897)
(cherry picked from commit 0c5c80928c)

Co-authored-by: beavailable <beavailable@proton.me>
2024-11-23 18:55:58 -08:00
Miss Islington (bot)
b1a241ef4c
[3.13] Doc: C API: Fix Py_NewInterpreterFromConfig example code (GH-126667) (#127201)
Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667)
(cherry picked from commit e3038e976b)

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2024-11-23 19:54:12 +00:00
Miss Islington (bot)
9291095a74
[3.13] Fix a few typos found in the docs (GH-127126) (GH-127181)
Fix a few typos found in the docs (GH-127126)
(cherry picked from commit 39e60aeb38)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-11-23 00:09:35 +00:00
Miss Islington (bot)
7f22b87d35
[3.13] gh-127001: Fix PATHEXT issues in shutil.which() on Windows (GH-127035) (GH-127156)
* Name without a PATHEXT extension is only searched if the mode does not
  include X_OK.
* Support multi-component PATHEXT extensions (e.g. ".foo.bar").
* Support files without extensions in PATHEXT contains dot-only extension
  (".", "..", etc).
* Support PATHEXT extensions that end with a dot (e.g. ".foo.").
(cherry picked from commit 8899e85de1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-11-22 16:18:44 +00:00
Miss Islington (bot)
1b58c0f308
[3.13] GH-122679: Add register() to argparse docs (GH-126939) (GH-127149)
(cherry picked from commit fcfdb55465)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-11-22 16:12:05 +02:00
Jun Komoda
af00c58652
[3.13] gh-127082: Replace "Windows only" with the availability: Windows in ctypes doc (GH-127099) (#127144)
(cherry picked from commit 3c770e3f09)
2024-11-22 14:09:53 +01:00
Serhiy Storchaka
6e5e7bc5f8
[3.13] gh-126727: Fix locale.nl_langinfo(locale.ERA) (GH-126730) (GH-127097)
It now returns multiple era description segments separated by semicolons.
Previously it only returned the first segment on platforms with Glibc.
(cherry picked from commit 4803cd0244)
2024-11-21 11:49:19 +00:00
Miss Islington (bot)
fd9c2a3727
[3.13] Doc: C API: PyThreadState::on_delete was removed in v3.13 (GH-126536) (#127053)
Doc: C API: `PyThreadState::on_delete` was removed in v3.13 (GH-126536)
(cherry picked from commit 9bca3ef575)

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2024-11-20 08:51:19 +00:00
Miss Islington (bot)
dd222a4d47
[3.13] Update docs 'make serve' to suggest 'make htmllive' (GH-126969) (#127015)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-11-19 17:41:33 +02:00
Sergey B Kirpichev
190d710e68
[3.13] Doc: Reorganize math module documentation (GH-126337) (#126998)
(cherry picked from commit ce453e6c2f)

Co-authored-by: Joseph Martinot-Lagarde <contrebasse@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-11-19 09:02:01 +01:00
Miss Islington (bot)
9b06a8d2f5
[3.13] Docs: re-create pages for removed modules to document their removal. (GH-126622) (#126709)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-11-17 22:20:32 +02:00
Miss Islington (bot)
c8962104f2
[3.13] Added a warning to the urljoin docs, indicating that it is not safe to use with attacker controlled URLs (GH-126659) (#126888)
Added a warning to the urljoin docs, indicating that it is not safe to use with attacker controlled URLs (GH-126659)

This was flagged to me at a party today by someone who works in red-teaming as a frequently encountered footgun. Documenting the potentially unexpected behavior seemed like a good place to start.
(cherry picked from commit d6bcc154e9)

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2024-11-15 23:15:27 +00:00
Miss Islington (bot)
9a02690513
[3.13] gh-123832: Adjust socket.getaddrinfo docs for better POSIX compliance (GH-126182) (GH-126825)
gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance (GH-126182)

* gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance

This changes nothing changes for CPython supported platforms,
but hints how to deal with platforms that stick to the letter of
the spec.
It also marks `socket.getaddrinfo` as a wrapper around `getaddrinfo(3)`;
specifically, workarounds to make the function work consistently across
platforms are out of scope in its code.

Include wording similar to the POSIX's “by providing options and by
limiting the returned information”, which IMO suggests that the
hints limit the resulting list compared to the defaults, *but* can
be interpreted differently. Details are added in a note.

Specifically say that this wraps the underlying C function. So, the
details are in OS docs. The “full range of results” bit goes away.

Use `AF_UNSPEC` rather than zero for the *family* default, although
I don't think a system where it's nonzero would be very usable.

Suggest setting proto and/or type (with examples, as the appropriate
values aren't obvious). Say why you probably want to do that that
on all systems; mention the behavior on the “letter of the spec”
systems.

Suggest that the results should be tried in order, which is,
AFAIK best practice -- see RFC 6724 section 2, and its predecessor
from 2003 (which are specific to IP, but indicate how people use this):

> Well-behaved applications SHOULD iterate through the list of
> addresses returned from `getaddrinfo()` until they find a working address.

(cherry picked from commit ff0ef0a54b)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-11-15 14:06:57 +01:00
Miss Islington (bot)
4fd628837c
[3.13] Document that return-less user-defined functions return None (GH-126769) (#126822)
Document that return-less user-defined functions return None (GH-126769)
(cherry picked from commit e0692f1165)

Co-authored-by: John Marshall <jmarshall@hey.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-11-14 10:46:58 +01:00
Miss Islington (bot)
94e536e283
[3.13] Doc: Recommend shlex.quote alongside pipes removal (GH-126570) (#126820)
Doc: Recommend shlex.quote alongside pipes removal (GH-126570)

One of the most common reasons I see the old `pipes` module still in use
when porting to Python 3.13 is for the undocumented `pipes.quote`
function, which can easily be replaced with `shlex.quote`.  I think it's
worth specifically calling this out, since being directed to the
`subprocess` module would be confusing in this case.
(cherry picked from commit 73e34b6808)

Co-authored-by: Colin Watson <cjwatson@debian.org>
2024-11-14 05:08:22 +00:00
Miss Islington (bot)
75d643166c
[3.13] gh-126731: Update outdated project information in pprint.pp doc (GH-126732) (#126818)
gh-126731: Update outdated project information in `pprint.pp` doc (GH-126732)
(cherry picked from commit 6a93a1adbb)

Co-authored-by: Wulian <xiguawulian@gmail.com>
2024-11-14 05:04:03 +00:00
Miss Islington (bot)
02cd3ce0f2
[3.13] gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-124865) (gh-125709) (GH-125204)
* gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-124865)

Fix a crash caused by immortal interned strings being shared between
sub-interpreters that use basic single-phase init. In that case, the string
can be used by an interpreter that outlives the interpreter that created and
interned it. For interpreters that share obmalloc state, also share the
interned dict with the main interpreter.

This is an un-revert of gh-124646 that then addresses the Py_TRACE_REFS
failures identified by gh-124785.
(cherry picked from commit f2cb399470)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>

* [3.13] gh-125286: Share the Main Refchain With Legacy Interpreters (gh-125709)

They used to be shared, before 3.12.  Returning to sharing them resolves a failure on Py_TRACE_REFS builds.

---------

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-11-12 13:45:12 +01:00
Miss Islington (bot)
e5e70c5f09
Update documentation links to Microsoft's documentation pages (GH-126379)
(cherry picked from commit 6e25eb1541)

Co-authored-by: 谭九鼎 <109224573@qq.com>
2024-11-11 17:18:01 +00:00
Miss Islington (bot)
90cf1af325
[3.13] Add missing fullstop . to whatsnew/3.8.rst (GH-126553) (#126672)
Add missing fullstop `.` to whatsnew/3.8.rst (GH-126553)
(cherry picked from commit 82269c7d58)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-11-11 07:05:15 +00:00
Miss Islington (bot)
47748758e7
[3.13] gh-126664: Use else instead of finally in "The with statement" documentation. (GH-126665) (#126670)
gh-126664: Use `else` instead of `finally` in "The with statement" documentation. (GH-126665)
(cherry picked from commit 25257d61cf)

Co-authored-by: vivodi <103735539+vivodi@users.noreply.github.com>
2024-11-11 06:54:26 +00:00
Miss Islington (bot)
3d8f5490e2
[3.13] gh-126543: Docs: change "bound type var" to "bounded" when used in the context of the 'bound' kw argument to TypeVar (GH-126584) (#126657)
(cherry picked from commit 434b29767f)

Co-authored-by: Pedro Fonini <fonini@protonmail.ch>
2024-11-10 18:48:44 -08:00
Miss Islington (bot)
4567ad2ce4
[3.13] gh-126647: Doc/using/configure.rst: Add an entry for `--enable-experimental-jit` option (GH-126648) (#126655)
gh-126647: `Doc/using/configure.rst`: Add an entry for ``--enable-experimental-jit`` option (GH-126648)

Add an entry for the ``--enable-experimental-jit`` option in ``Doc/using/configure.rst``.
This was added as an experimental option in CPython 3.13.
Possible values for it:
* `no` - don't build the JIT.
* `yes` - build the JIT.
* `yes-off` - build the JIT but disable it by default.
* `interpreter` - don't build the JIT but enable tier 2 interpreter instead.

(cherry picked from commit f435de6765)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-11-10 21:51:21 +00:00