Commit graph

120419 commits

Author SHA1 Message Date
donBarbos
baea0e2b05
[3.12] gh-130160: use .. program:: directive for documenting http.server CLI (GH-131010) (#131294)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-03-17 10:28:11 +02:00
Miss Islington (bot)
c5a23ab9a6
[3.12] gh-131327: Document winsound.SND_APPLICATION (GH-131328) (#131329)
gh-131327: Document winsound.SND_APPLICATION (GH-131328)
(cherry picked from commit bf4c1bf344)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-16 15:45:57 +00:00
Miss Islington (bot)
1d17f1a979
[3.12] gh-130160: use .. program:: directive for documenting doctest CLI (GH-131034) (#131321)
gh-130160: use `.. program::` directive for documenting `doctest` CLI (GH-131034)
(cherry picked from commit 9558d22ac3)

Co-authored-by: donBarbos <donbarbos@proton.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-16 12:00:39 +00:00
Wulian233
e364a4212e
[3.12] gh-131204: Fix difflib.HtmlDiff may not use monospaced font (GH-131221) (#131243)
(cherry picked from commit 7fd6160)
2025-03-14 12:23:39 +00:00
Miss Islington (bot)
9a612a850c
[3.12] gh-131234: Improve test_popen with more asserts (GH-131235) (#131241)
gh-131234: Improve `test_popen` with more asserts (GH-131235)
(cherry picked from commit fc07f863ee)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-03-14 11:54:56 +00:00
sobolevn
6658ada1ea
[3.12] gh-131219: Improve tests in test_lzma.py by adding more asserts (GH-131220) (#131237)
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-03-14 11:54:37 +00:00
Miss Islington (bot)
77ece5aed8
[3.12] gh-130814: Enhance documentation for Python C API type objects (GH-130817) (#131224)
gh-130814: Enhance documentation for Python C API type objects (GH-130817)

The "Type Objects" title in `c-api/typeobj.rst`, duplicating the title of `c-api/type.rst`,
has been changed to "Type Objects Structures", thereby slightly improving Sphinx
search.
(cherry picked from commit 6b932edc52)

Co-authored-by: sharktide <meherrihaan@gmail.com>
2025-03-14 10:01:05 +00:00
Miss Islington (bot)
39b4f8b6ed
[3.12] gh-124269: Simplify typing.Annotated docs (GH-130770) (#131223)
gh-124269: Simplify `typing.Annotated` docs (GH-130770)

---------
(cherry picked from commit e4ac196aaa)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-14 09:54:08 +00:00
Serhiy Storchaka
a3f4889413
[3.12] gh-85012: Properly reset msgctxt when compiling messages with msgfmt (GH-130525) (GH-131206)
Add also human-readable snapshots for tests.
(cherry picked from commit 7ea6e88eb4)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-03-13 19:09:42 +00:00
Alexandra
ba363894bb
[3.12] gh-131181: Assert that PyObject_stgdict isn't NULL for PyCData (#131188)
PyCData types have stgdict, so `PyObject_stgdict` can not return NULL.
Add an assert to make this clear.
2025-03-13 15:06:39 +00:00
Miss Islington (bot)
969631aec9
[3.12] gh-93096: Load doctests in test_itertools (GH-131133) (#131137)
gh-93096: Load doctests in `test_itertools` (GH-131133)
(cherry picked from commit 15a8412b5e)

Co-authored-by: donBarbos <donbarbos@proton.me>
2025-03-12 08:00:17 +00:00
Miss Islington (bot)
afffd97cd9
[3.12] gh-130957: Use sleeping_retry in test_free_reference (GH-130958) (#131092)
The weak reference may not be immediately dead.
(cherry picked from commit 1908115871)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-03-11 10:13:41 -04:00
Yuki Kobayashi
729ec5b4fc
[3.12] gh-101100: Fix sphinx warnings in library/asyncio-subprocess.rst (GH-130994) (#131075)
(cherry picked from commit 7cc99a54b7)
2025-03-11 12:31:33 +00:00
Miss Islington (bot)
8f26a79b33
gh-130959: Reject whitespace in fractions, in pure Python fromisoformat() (GH-130962) (GH-131076) (#131086)
Fix the pure Python implementation of `fromisoformat()` to reject any
non-digit characters, including whitespace, in the fractional part
of time specification.  This makes the behavior consistent with the C
implementation, and prevents incorrect parsing of these fractions
(e.g. `.400 ` would be misinterpreted as `.04`).

(cherry picked from commit 33494b4d0d)
(cherry picked from commit 27fd328cf6)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Michał Górny <mgorny@gentoo.org>
2025-03-11 12:00:06 +00:00
Victor Stinner
3f226c5a7f
[3.12] gh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (#131044) (#131085)
gh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (#131044)

(cherry picked from commit de8818ae23)

Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
2025-03-11 11:55:13 +00:00
Miss Islington (bot)
bfad0b56d9
[3.12] gh-93096: Fix loading doctests in test_pickle (GH-131069) (GH-131081)
(cherry picked from commit 3bb20d13a8)

Co-authored-by: donBarbos <donbarbos@proton.me>
2025-03-11 10:42:47 +00:00
Kyle Cutler
33605da91c
[3.12] gh-130809: Fix PyFrame_LocalsToFast copying the wrong value (#130816)
* gh-130809: Fix `PyFrame_LocalsToFast` copying the wrong value

* Skip hidden locals

* test, blurb

* Update Misc/NEWS.d/next/Core_and_Builtins/2025-03-04-12-52-21.gh-issue-130809.fSXq60.rst

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>

* Update test

* PR feedback

* formatting

* comment

---------

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2025-03-10 20:27:07 -04:00
Miss Islington (bot)
fcf1f57d91
[3.12] gh-125331: Allow the parser to activate future imports on the fly (GH-125482) (#131063)
gh-125331: Allow the parser to activate future imports on the fly (GH-125482)
(cherry picked from commit 3bd3e09588)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-03-10 22:13:59 +00:00
Miss Islington (bot)
22ac71dc8e
gh-131020: py.exe launcher does not correctly detect a BOM when searching for the shebang (GH-131021)
(cherry picked from commit 36ef3bfe39)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-03-10 20:12:40 +00:00
Miss Islington (bot)
c82795a0bb
[3.12] gh-130711: Document PyBaseObject_Type (GH-130712) (GH-130793)
(cherry picked from commit b3c18bfd82)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-03-10 15:05:45 +01:00
Miss Islington (bot)
8584790d6f
[3.12] gh-80421: Correct definitions of time (GH-130984) (#131023)
gh-80421: Correct definitions of time (GH-130984)

Based on the Wikipedia article, UTC is better said to be a successor than a renaming of GTC and language agnostic rather than an English-French compromise.
(cherry picked from commit 98fa4a49fe)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-03-09 20:18:31 +00:00
Miss Islington (bot)
9f7f2c0df1
[3.12] gh-130160: use .. program:: directive for documenting pdb CLI (GH-130996) (#131013)
gh-130160: use `.. program::` directive for documenting `pdb` CLI (GH-130996)
(cherry picked from commit c240c2d88a)

Co-authored-by: donBarbos <donbarbos@proton.me>
2025-03-09 16:18:43 +00:00
donBarbos
11d550c2f3
[3.12] gh-130160: use .. program:: directive for documenting webbrowser CLI (GH-130995) (#131004)
* gh-130160: use `.. program::` directive for documenting `webbrowser` CLI (#130995)

use `.. program::` directive for documenting `webbrowser` CLI

(cherry picked from commit 92e5f826ac)

* remove extra paragraph
2025-03-09 07:33:56 +00:00
Miss Islington (bot)
552dad1692
[3.12] gh-123726: Document caveats of zipfile.Path around name sanitization (GH-130537) (#130987)
gh-123726: Document caveats of zipfile.Path around name sanitization (GH-130537)

Add a note to the `zipfile.Path` class documentation clarifying that it does not sanitize filenames. This emphasizes the caller's responsibility to validate or sanitize inputs, especially when handling untrusted ZIP archives, to prevent path traversal vulnerabilities. The note also references the `extract` and `extractall` methods for comparison and suggests using `os.path.abspath` and `os.path.commonpath` for safe filename resolution.
(cherry picked from commit a3990df612)

Co-authored-by: Affan Shaikhsurab <51104750+AffanShaikhsurab@users.noreply.github.com>
2025-03-08 21:45:48 +00:00
Miss Islington (bot)
a69107b335
[3.12] gh-130917: update timer and workload in test_signal (GH-130918) (#130968)
The workload to advance the virtual timeout is too lightweight for some
platforms. As result the test goes in timeout as it never reaches the
end of the timer. By having a heavier workload, the virtual timer
advances rapidly and the SIGVTALRM is sent before the timeout.
(cherry picked from commit 7879081198)

Co-authored-by: Diego Russo <diego.russo@arm.com>
2025-03-08 18:21:46 +00:00
Miss Islington (bot)
4eb4785afd
[3.12] gh-130954: Fix multiprocessing test_notify_n (GH-130955) (#130982)
The test could deadlock trying join on the worker processes.
Apply the same technique as gh-130933.

Join the process before the test ends in `test_notify` as well.
(cherry picked from commit edd1eca336)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-03-08 18:21:37 +00:00
Hugo van Kemenade
d128edb0ec
[3.12] gh-113238: add Anchor to importlib.resources (GH-113801) (#130499)
(cherry picked from commit c85c0026a6)

Co-authored-by: Mike Zimin <122507876+mikeziminio@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2025-03-08 11:27:34 -05:00
Miss Islington (bot)
4230697886
[3.12] gh-110206: Fix multiprocessing test_notify_all (GH-130933) (#130951)
The test could deadlock trying join on the worker processes due to a
combination of behaviors:

* The use of `assertReachesEventually` did not ensure that workers
  actually woken.release() because the SyncManager's Semaphore does not
  implement get_value.

* This mean that the test could finish and the variable "sleeping" would
  got out of scope and be collected. This unregisters the proxy leading
  to failures in the worker or possibly the manager.

* The subsequent call to `p.join()` during cleanUp therefore never
  finished.

This takes two approaches to fix this:

1) Use woken.acquire() to ensure that the workers actually finish
   calling woken.release()

2) At the end of the test, wait until the workers are finished, while `cond`,
   `sleeping`, and `woken` are still valid.
(cherry picked from commit c476410dc5)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-03-07 12:20:00 -05:00
Miss Islington (bot)
56fa6f39ff
[3.12] Correct function name in Doc/extending/embedding.rst (GH-127539) (#130946)
Correct function name in `Doc/extending/embedding.rst` (GH-127539)
(cherry picked from commit e5527f2cdd)

Co-authored-by: Boris Verkhovskiy <boris.verk@gmail.com>
2025-03-07 13:14:25 +00:00
Miss Islington (bot)
397e69d009
[3.12] gh-127371 Avoid unbounded growth SpooledTempfile.writelines (GH-127372) (#130885)
gh-127371 Avoid unbounded growth SpooledTempfile.writelines (GH-127372)
(cherry picked from commit cb67b44ca9)

Co-authored-by: Bert Peters <bert@bertptrs.nl>
2025-03-05 18:42:35 +01:00
Miss Islington (bot)
60be65aaf0
[3.12] Update links from typing.readthedocs.io to typing.python.org (GH-130877) (#130884)
Update links from typing.readthedocs.io to typing.python.org (GH-130877)
(cherry picked from commit 4f6218959e)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2025-03-05 15:35:46 +00:00
Miss Islington (bot)
ed015d05f2
[3.12] gh-116742: Fix subprocess test_check_output_timeout() (GH-130836) (#130874)
gh-116742: Fix subprocess test_check_output_timeout() (GH-130836)

Fix a race condition in test_check_output_timeout() of
test_subprocess. Don't write into stdout anymore, since there is no
reliable way to synchronize the parent and the child processes.

Change the timeout from 3 seconds to 0.1 seconds, and remove
@requires_resource('walltime') decorator.
(cherry picked from commit 67a942d427)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-05 13:00:41 +01:00
Petr Viktorin
8fe011af38
[3.12] gh-130824: Add tests for NULL in PyLong_*AndOverflow functions (GH-130828) (GH-130876)
(cherry picked from commit 90130807d9)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-03-05 13:52:40 +02:00
Miss Islington (bot)
919300e42a
[3.12] GH-125722: Increase minimum supported Sphinx to 8.2.0 (GH-130444) (#130859)
GH-125722: Increase minimum supported Sphinx to 8.2.0 (GH-130444)
(cherry picked from commit e53d105872)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-03-05 00:38:04 +00:00
Miss Islington (bot)
45e667c7c2
[3.12] gh-130730: Fix multiprocessing test_active_children() (GH-130837) (#130846)
gh-130730: Fix multiprocessing test_active_children() (GH-130837)

Replace a sleep with an event: sleep is not a reliable
synchronization primitive.
(cherry picked from commit 3dd3675492)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-04 17:22:12 +00:00
sobolevn
50270fc980
[3.12] gh-129567: Add a note to typing.TypedDict docs about name mangling (GH-130233) (#130842) 2025-03-04 15:34:34 +00:00
Miss Islington (bot)
a0ac4dbe88
[3.12] gh-130736: Fix asyncio test_shutdown_default_executor_timeout() (GH-130800) (#130826)
gh-130736: Fix asyncio test_shutdown_default_executor_timeout() (GH-130800)

Replace time.sleep() with threading.Event.
(cherry picked from commit 6c48ed7d62)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-04 17:41:00 +05:30
Bénédikt Tran
7ce5f15981
[3.12] gh-130740: Move some stdbool.h includes after Python.h (#130738) (#130757)
gh-130740: Move some `stdbool.h` includes after `Python.h` (#130738)

Move some `#include <stdbool.h>` after `#include "Python.h"` when `pyconfig.h` is not
included first and when we are in a platform-agnostic context. This is to avoid having
features defined by `stdbool.h` before those decided by `Python.h` (this caused some
build failures when compiling CPython with `zig cc`).

(cherry-picked from commit 214562ed4d)

---------

Co-authored-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
2025-03-04 10:38:24 +01:00
Miss Islington (bot)
519dec97e7
[3.12] gh-130737: Fix multiprocessing test_notify() (GH-130797) (#130803)
gh-130737: Fix multiprocessing test_notify() (GH-130797)

Replace hardcoded delay (100 ms) with a loop awaiting until a
condition is true: replace assertReturnsIfImplemented() with
assertReachesEventually().

Use sleeping_retry() in assertReachesEventually() to tolerate slow
buildbots and raise an exception on timeout (30 seconds).
(cherry picked from commit 8a64a62002)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-03 19:02:20 +00:00
Hugo van Kemenade
3614649714
[3.12] gh-129583: update bundled pip to 25.0.1 (GH-129909) (#129947)
(cherry picked from commit b8f7bddd6c)

Co-authored-by: Stéphane Bidoul <stephane.bidoul@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2025-03-03 17:46:07 +02:00
Miss Islington (bot)
23f11e32c2
[3.12] Docs: Fix a misplaced statement in the document for ServerProxy (GH-130616) (GH-130639)
Docs: Fix a misplaced statement in the document for `ServerProxy` (GH-130616)

The sentence "If an HTTPS URL ..." explains what the parameter means,
so moved it to the paragraph explaining what the other parameters mean.
(cherry picked from commit b26286ca49)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-03-03 15:09:20 +01:00
Bénédikt Tran
d25da89953
[3.12] gh-127667: fix memory leaks in hashlib (GH-127668) (#130783)
gh-127667: fix memory leaks in `hashlib` (GH-127668)

- Correctly handle `NULL` values returned by `EVP_MD_CTX_md`.
- Correctly free resources in error branches.
- Consistently suppress `_setException()` return value when needed.
- Collapse `_setException() + return NULL` into a single statement.

(cherry-picked from commit 097846502b)
2025-03-03 10:44:42 +00:00
Hugo van Kemenade
a22cfd4244
[3.12] gh-101100: Fix Sphinx documentation warnings in collections.rst (GH-130629) (#130782)
(cherry picked from commit 373eb1b47a)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
2025-03-03 10:05:58 +00:00
Miss Islington (bot)
9b28a4edee
[3.12] gh-101100: Fix sphinx warnings in library/email.errors.rst (GH-130774) (#130780)
gh-101100: Fix sphinx warnings in `library/email.errors.rst` (GH-130774)
(cherry picked from commit a105f99019)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-03-03 12:05:12 +02:00
Miss Islington (bot)
43635f2f52
[3.12] gh-129015: Improve disambiguation between NotImplemented and NotImplementedError (GH-129562) (#130777)
gh-129015: Improve disambiguation between `NotImplemented` and `NotImplementedError` (GH-129562)

---------

(cherry picked from commit a85eeb9771)

Co-authored-by: Mike Castle <dalgoda+github@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-03-03 08:31:08 +00:00
Miss Islington (bot)
d9ca98a92d
[3.12] gh-130637: Add validation for numeric response data in stat() method (GH-130646) (#130764)
gh-130637: Add validation for numeric response data in `stat()` method (GH-130646)
(cherry picked from commit a42168d316)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2025-03-02 15:05:46 -05:00
Miss Islington (bot)
96e6932bef
[3.12] Fix grammar typo in Doc/c-api/arg.rst (GH-130741) (#130758)
Fix grammar typo in `Doc/c-api/arg.rst` (GH-130741)
(cherry picked from commit 37145cb89f)

Co-authored-by: Arijit Kumar Das <arijitkrdas2004@outlook.com>
2025-03-02 11:21:57 +00:00
Miss Islington (bot)
257240e723
[3.12] Add link in the importlib.metadata.version() docs (GH-130739) (#130760)
Add link in the `importlib.metadata.version()` docs (GH-130739)

Link the specification for the returned data makes it clearer what this is
and what the format of the version string can be.
(cherry picked from commit c71e55869e)

Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
2025-03-02 10:43:06 +00:00
Miss Islington (bot)
a0676db61e
[3.12] gh-128481: Improve documentation for traceback.FrameSummary (GH-128484) (#130754)
* gh-128481: Improve documentation for `traceback.FrameSummary` (GH-128484)

Complete the `traceback.FrameSummary` signature and add missing
documentation for the `colno` and `end_{col,line}no` attributes.
(cherry picked from commit 051f0e5683)

Co-authored-by: Damien <81557462+Damien-Chen@users.noreply.github.com>
2025-03-02 09:50:32 +00:00
Miss Islington (bot)
c192944362
[3.12] gh-130160: use .. program:: directive for documenting cProfile CLI (GH-130314) (#130746)
gh-130160: use `.. program::` directive for documenting `cProfile` CLI (GH-130314)
(cherry picked from commit 5181ddb29f)

Co-authored-by: Apostol Fet <90645107+ApostolFet@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-03-01 20:46:45 +00:00