Commit graph

51733 commits

Author SHA1 Message Date
Bénédikt Tran
865bd6de99
[3.12] gh-131277: allow EnvironmentVarGuard to unset more than one environment variable at once (GH-131280) (#131410)
(cherry picked from commit 3185e3115c)

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-03-18 13:46:24 +01:00
Miss Islington (bot)
c1faeadd82
[3.12] gh-131325: fix sendfile fallback implementation to drain data after writing to transport (GH-131376) (#131378)
gh-131325: fix sendfile fallback implementation to drain data after writing to transport (GH-131376)
(cherry picked from commit 94f4d87aeb)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-03-17 19:40:43 +00:00
Miss Islington (bot)
18e4eb410a
[3.12] gh-130727: Retry test_wmi on TimeoutError (GH-130832) (#130840)
gh-130727: Retry test_wmi on TimeoutError (GH-130832)

Use sleeping_retry() in test_wmi to retry multiple times on
TimeoutError. Wait up to LONG_TIMEOUT seconds (5 minutes by default).
(cherry picked from commit f67ff9e820)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-17 15:57:28 +00:00
Miss Islington (bot)
6e7432f130
[3.12] gh-131339: test PyBytes_Size for a zero-size bytes object (GH-131340) (#131344)
gh-131339: test PyBytes_Size for a zero-size bytes object (GH-131340)
(cherry picked from commit 3ae67ba97e)

Co-authored-by: Nybblista <170842536+nybblista@users.noreply.github.com>
2025-03-17 12:20:32 +00:00
Miss Islington (bot)
e5e8b8ab44
[3.12] gh-129843: fix pure Python implementation of warnings.warn_explicit (GH-129848) (#131350)
gh-129843: fix pure Python implementation of `warnings.warn_explicit` (GH-129848)

The pure Python implementation of `warnings.warn_explicit` constructs a `WarningMessage`
with an incorrect source (it incorrectly sets the WarningMessage's line to the given `source`).
(cherry picked from commit 80e00ecc39)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <thatiparthysreenivas@gmail.com>
2025-03-17 12:19:09 +01: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
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
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
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
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)
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)
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)
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)
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
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
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)
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
Pablo Galindo Salgado
0860d9c72f
[3.12] gh-130618: Fix parser error when using lambdas inside f-strings (GH-130638) (#130644)
(cherry picked from commit e06bebb87e)
2025-03-01 18:10:07 +00:00
Miss Islington (bot)
99e18abe6f
[3.12] Revert "gh-128364: Fix flaky test_timeout test (gh-130724)" (gh-130732) (#130735)
Revert "gh-128364: Fix flaky `test_timeout` test (gh-130724)" (gh-130732)

Change broke Android and iOS buildbots that do not have multiprocessing.

This reverts commit cfa0b1dc37.
(cherry picked from commit 5221d9ce0e)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-03-01 17:40:51 +00:00
Miss Islington (bot)
27f9f2b98a
[3.12] gh-128364: Fix flaky test_timeout test (gh-130724) (gh-130729)
gh-128364: Fix flaky `test_timeout` test (gh-130724)
(cherry picked from commit cfa0b1dc37)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-03-01 16:40:53 +00:00
Miss Islington (bot)
d922aa80fd
[3.12] gh-130607: Extend and cleanup IPv6 tests (GH-121518) (GH-130678)
Extend IPv6 tests and made little syntax refactoring
(cherry picked from commit 9f0879baf1)

Co-authored-by: Ilya Bazhenov <31971067+bazhil@users.noreply.github.com>
2025-02-28 12:41:34 +01:00
Vinay Sajip
4eb14211a5
[3.12] gh-112507: Detect Cygwin and MSYS with uname instead of $OSTYPE (GH-112508) (GH-130674)
(cherry picked from commit d7b5f10231)
2025-02-28 09:23:45 +00:00
Miss Islington (bot)
aa91a11c40
[3.12] gh-130655: Increase test coverage of gettext._expand_lang() (GH-130656) (GH-130672)
(cherry picked from commit 24c52cb14c)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-02-28 08:58:09 +00:00
Miss Islington (bot)
500ea3b0ee
[3.12] gh-129726: Break gzip.GzipFile reference loop (GH-130055) (#130670)
gh-129726: Break `gzip.GzipFile` reference loop (GH-130055)

A reference loop was resulting in the `fileobj` held by the `GzipFile`
being closed before the `GzipFile`.

The issue started with gh-89550 in 3.12, but was hidden in most cases
until 3.13 when gh-62948 made it more visible.
(cherry picked from commit 7f39137662)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-02-28 08:28:14 +00:00
Hugo van Kemenade
b8f2ff08f1
[3.12] gh-125553: Fix backslash continuation in untokenize (GH-126010) (#130579)
(cherry picked from commit 7ad793e5db)

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2025-02-27 21:57:13 +00:00
Hugo van Kemenade
a55a9cd6c2
[3.12] GH-92897: schedule the check_home deprecation to 3.15 (GH-129102) (#130585)
Co-authored-by: Filipe Laíns 🇵🇸 <lains@riseup.net>
2025-02-27 18:17:08 +00:00
Petr Viktorin
a678d8e511
[3.12] gh-129405: Fix doc for Py_mod_multiple_interpreters default, and add test (GH-129406) (GH-130510) 2025-02-27 16:30:46 +01:00
Adam Turner
fb073b5e3b
[3.12] GH-121970: Extract pydoc_topics into a new extension (#129116) (#130443)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-02-27 14:18:54 +00:00
Serhiy Storchaka
89a79fc919
[3.12] gh-130163: Fix crashes related to PySys_GetObject() (GH-130503) (GH-130556) (GH-130576)
The use of PySys_GetObject() and _PySys_GetAttr(), which return a borrowed
reference, has been replaced by using one of the following functions, which
return a strong reference and distinguish a missing attribute from an error:
_PySys_GetOptionalAttr(), _PySys_GetOptionalAttrString(),
_PySys_GetRequiredAttr(), and _PySys_GetRequiredAttrString().

(cherry picked from commit 0ef4ffeefd)
(cherry picked from commit 7c1b76fce8)
(cherry picked from commit 2ab7e1135a)
2025-02-26 17:20:47 +02:00
Victor Stinner
c4aeb4c444
[3.12] GH-130396: Treat clang -Og as optimized for gdb tests (GH-130550) (#130573)
GH-130396: Treat clang -Og as optimized for gdb tests (GH-130550)

(cherry picked from commit 129db32d6f)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2025-02-26 12:38:21 +01:00
Hugo van Kemenade
e28097682e
[3.12] gh-108303: Fix and move badsyntax_pep3120.py (GH-109513) (#130540)
(cherry picked from commit 4dd47c63a9)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-02-26 09:46:12 +02:00
Miss Islington (bot)
def2ee1280
[3.12] Fix a typo in code module test (GH-130530) (GH-130533)
(cherry picked from commit 56e337d32b)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2025-02-25 09:54:15 +00:00
Miss Islington (bot)
8db2fa2575
[3.12] gh-130285: Fix handling of zero or empty counts in random.sample() (gh-130291) (gh-130417) 2025-02-21 17:48:46 +00:00
Miss Islington (bot)
dd5bf313c6
[3.12] gh-129363: Change regrtest sequential mode output (GH-129476) (#130406)
gh-129363: Change regrtest sequential mode output (GH-129476)

First, write the test name without color. Then, write the test name
and the result with color. Each test is displayed twice.
(cherry picked from commit f1b81c408f)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-02-21 14:16:27 +00:00
Miss Islington (bot)
6c4de3259d
[3.12] Fix outdated reference link in collections module (gh-130349) (gh-130387) 2025-02-21 00:15:48 +00:00
Hugo van Kemenade
ecfca20719
[3.12] gh-119727: Add --single-process option to regrtest (GH-119728) (#130359)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-02-20 15:47:10 +00:00
Sam Gross
60410f3c76
[3.12] gh-129269: Exclude everything in sys.path in test_coverage_ignore (gh-130133) (gh-130358)
The `test_trace.test_coverage_ignore` test would fail if you had
`setuptools` installed, such as in `~/.local/lib/python3.xxx/site-packages/`.
Ignore everything in `sys.path` when running the test.
(cherry picked from commit 35925e9529)
2025-02-20 15:37:43 +00:00
Miss Islington (bot)
e63ca56e3b
[3.12] gh-127750: Backport some tests for singledispatchmethod (GH-130309) (GH-130340) (GH-130341)
(cherry picked from commit 68c57d6f33)

(cherry picked from commit 395335d0ff)
(cherry picked from commit 10b32054ad)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-02-20 12:16:19 +00:00
Miss Islington (bot)
96a914ad7e
[3.12] gh-130250: use support.swap_attr() in test and don't assume we're beginning with a clean system state (GH-130342) (#130345)
gh-130250: use support.swap_attr() in test and don't assume we're beginning with a clean system state (GH-130342)
(cherry picked from commit 048ee2d5ec)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2025-02-20 11:45:42 +00:00