Commit graph

34497 commits

Author SHA1 Message Date
Tomasz Pytel
539461d9ec
gh-139516: Fix lambda colon start format spec in f-string in tokenizer (#139657) 2025-10-07 17:28:15 +01:00
Furkan Onder
171f787a29
gh-138854: Skip test_script_shadowing_stdlib_cwd_failure on AIX (GH-138855) 2025-10-06 17:42:26 +00:00
sobolevn
7c70cc5c23
gh-133210: Fix test_inspect without docstrings (#139651) 2025-10-06 19:48:50 +03:00
Mikhail Efimov
708de26e31
gh-133210: Fix test_pydoc without docstrings (#139654) 2025-10-06 16:51:10 +02:00
Cycloctane
b73aaffb3d
gh-133951: Fix purelib packages not found in test_peg_generator TestCParser (GH-139607)
also includes purelib in TestCParser import context
2025-10-06 14:40:48 +02:00
yihong
36a6c2cdfa
gh-139646: fix typo in pickletools error message (#139647)
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
2025-10-06 10:52:45 +00:00
Furkan Onder
6f3dae0dc5
gh-139624: Skip problematic locales on AIX in test_date_locale2 (GH-139625) 2025-10-06 11:38:01 +02:00
Malcolm Smith
a9b0506d8d
gh-137242: Allow Android testbed to take all Python command-line options (#138805)
Modifies the Android test runner to ensure that all valid Python command line
options are preserved when running the test suite.
2025-10-06 13:19:48 +08:00
Bénédikt Tran
1fe89d324e
gh-70765: fix an HTTP/0.9 flaky test post GH-139514 (#139610)
Fix a flaky test introduced in 13dc2fde8c.

After a single HTTP/0.9 request, both client and server are expected to
close the connection on their side. In particular, if a client sends two
requests with the same connection, only the first one should be handled.

In the tests, it might happen that checking for the second request to be
ignored did not take into account that the server may have already closed
the connection. This flaky behavior was first observed on macOS CI workers
but could not be reproduced locally on a Linux machine.
2025-10-05 16:51:16 +00:00
Sebastian Pipping
6edb2ddb5f
gh-139400: Make sure that parent parsers outlive their subparsers in pyexpat (#139403)
* Modules/pyexpat.c: Disallow collection of in-use parent parsers.

Within libexpat, a parser created via `XML_ExternalEntityParserCreate`
is relying on its parent parser throughout its entire lifetime.
Prior to this fix, is was possible for the parent parser to be
garbage-collected too early.
2025-10-05 17:37:42 +02:00
Bénédikt Tran
13dc2fde8c
gh-70765: avoid waiting for HTTP headers when parsing HTTP/0.9 requests (#139514) 2025-10-05 12:03:25 +00:00
Victor Stinner
efd223da0c
gh-64327: Remove skipped pydoc tests (#139512)
Tests skipped since 2014:
since commit a46ef70bdf.
2025-10-05 12:49:03 +02:00
Bénédikt Tran
41712c4e09
gh-139310: skip test_aead_aes_gcm for Linux kernel between 6.16.0 and 6.17.x (#139552)
Currently, Fedora 42 uses a custom Linux Kernel 6.16.9 that backported an upstream change
from 6.17-rc7 [1,3] but not its subsequent fix [2]. Until the issue is resolved upstream,
we skip the failing test `test_socket.test_aead_aes_gcm` for kernel versions between 6.16
and 6.17.x.

[1] 1b34cbbf4f
[2] d0ca0df179.
[3] 45bcf60fe4
2025-10-05 10:27:16 +02:00
Serhiy Storchaka
9e3542a6c2
gh-136097: Fix sysconfig._parse_makefile() (#136166)
* Fix potential infinite recursion.
* Fix a bug when reference can cross boundaries of substitutions, e.g.
  a=$(
  b=$(a)a)
* Fix potential quadratic complexity.
* Fix KeyError for undefined CFLAGS, LDFLAGS, or CPPFLAGS.
* Fix infinite recursion when keep_unresolved=False.
* Unify behavior with keep_unresolved=False for bogus $ occurred before
  and after variable references.
2025-10-04 14:57:12 +01:00
Furkan Onder
ae6e7f572c
gh-139308: Skip test_special_chars_csh on NetBSD due to csh variable expansion issue (#139341)
Skip test_special_chars_csh on NetBSD due to csh variable expansion issue

Co-authored-by: Filipe Laíns 🇵🇸 <lains@riseup.net>
2025-10-04 13:56:43 +00:00
Cycloctane
a7a485558c
gh-133951: Remove lib64->lib symlink in venv creation (#137139)
* Remove lib64->lib symlink in venv directory

* fix test

* remove unused import

* add news
2025-10-04 14:55:17 +01:00
Semyon Moroz
8d17d79299
gh-138044: Remove deprecated parameter alias for importlib.resources.files (#138059) 2025-10-04 14:53:43 +01:00
sobolevn
18d4e2ecd4
gh-133210: Fix test_types with --without-doc-strings (#139548) 2025-10-03 21:52:45 +00:00
Dino Viehland
ff0cf0af10
gh-139525: Don't specialize functions which have a modified vectorcall (#139524)
Don't specialize functions which have a modified vectorcall
2025-10-03 09:58:32 -07:00
Kumar Aditya
aa99a7c70c
gh-105987: unskip test_issue105987 from test_asyncio.test_eager_task_factory (#139538) 2025-10-03 07:18:57 +00:00
Angela Liss
fd7dac0430
gh-137840: Implement PEP 728 (closed and extra_items in typing.TypedDict) (#137933)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-10-02 22:50:19 -07:00
Victor Stinner
4e7e2dd043
gh-139322: Reenable test_os.test_getlogin() (#139498)
Fix also getlogin() errno.
2025-10-02 20:51:57 +00:00
Victor Stinner
af01b46866
gh-139322: Remove redundant test_os.Win32ErrorTests (#139477)
test_os.OSErrorTests already covers the OSError class and is more
complete than Win32ErrorTests.
2025-10-02 20:46:25 +02:00
Victor Stinner
9bf69659e1
gh-55258: Reenable support test_get_original_stdout() (#139499) 2025-10-02 18:10:36 +02:00
Victor Stinner
ea4027e179
gh-139504: Catch BrokenPipeError in ssl test_client_sigalgs_mismatch() (#139505)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-02 18:08:29 +02:00
Victor Stinner
8797e1a8c3
gh-77476: Remove urllib HTTP test (#139502)
Remove test_sites_no_connection_close() which is skipped since 2018
(commit 36d56ea826).
2025-10-02 17:30:08 +02:00
Victor Stinner
6826ebf986
gh-89745: Remove test_embed.test_init_read_set() (#139500)
Since Python 3.11, it's no longer possible to call PyConfig_Read() to
get the path configuration, and then modify the path configuration.
2025-10-02 16:52:10 +02:00
Victor Stinner
c985822d86
gh-135329: Use longer timeout in pyrepl test_repl_eio() (#139503)
Replace hardcoded 5 seconds with support.SHORT_TIMEOUT.

Fix the following error on slow CI such as GitHub Action UBSan:

test test_pyrepl failed -- Traceback (most recent call last):
  File "Lib/test/test_pyrepl/test_unix_console.py", line 362, in test_repl_eio
    _, err = proc.communicate(timeout=5)  # sleep for pty to settle
             ~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "Lib/subprocess.py", line 1219, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
                     ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Lib/subprocess.py", line 2126, in _communicate
    self._check_timeout(endtime, orig_timeout, stdout, stderr)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Lib/subprocess.py", line 1266, in _check_timeout
    raise TimeoutExpired(
    ...<2 lines>...
            stderr=b''.join(stderr_seq) if stderr_seq else None)
subprocess.TimeoutExpired: Command '[...]' timed out after 5 seconds
2025-10-02 16:44:02 +02:00
ivonastojanovic
75b1afe562
gh-135953: Add Gecko reporter to sampling profiler (#139364)
Signed-off-by: Pablo Galindo Salgado <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
2025-10-01 21:18:54 +01:00
Victor Stinner
0158890005
gh-139322: Create test_os package (#139453)
* Move test_posix.py and test_os.py to Lib/test/test_os/.
* Split Windows specific test cases to a new test_windows.py file.
2025-10-01 16:42:45 +02:00
Nadeshiko Manju
f39dea3bae
gh-123828: Fix data race in _interpchannels._waiting_release (GH-124107) 2025-10-01 11:34:47 +00:00
Cody Maloney
ce23eeaa2b
gh-138013: Split BufferedIO tests from test_io.test_general (#139454)
The last remaining set of tests to split out that are focused on one
specific implementation portion (`bufferedio.c`).

test_io.test_general is now largely tests around `io.open` and module
properties (ex. pickling, class hierarchy, module members, etc).

This closes #138013.
2025-10-01 09:06:26 +02:00
Ken Jin
c86eb4d3ac
gh-139210: Fix use-after-free in xml.etree.ElementTree.iterparse() (GH-139211) 2025-09-30 20:50:50 +03:00
Cody Maloney
f752fde452
gh-138013: Split TextIO tests from test_io.test_general (#139173)
gh-138013: Split TextIO tests from test_general

These tests take 1.3 seconds on my dev machine, match fairly closely
with testing `textio.c` implementation only.
2025-09-30 17:37:15 +02:00
Serhiy Storchaka
b2f5ad0c6d
gh-63161: Add more tests for source encoding (#139440) 2025-09-30 12:20:17 +03:00
Bénédikt Tran
bc172ee830
gh-139283: correctly handle size limit in cursor.fetchmany() (#139296)
Passing a negative or zero size to `cursor.fetchmany()` made it fetch all rows
instead of none.

While this could be considered a security vulnerability, it was decided to treat
this issue as a regular bug as passing a non-sanitized *size* value in the first
place is not recommended.
2025-09-30 11:18:55 +02:00
AN Long
bd1ada6df3
gh-138092: Allow calling mmap.flush with offset only (#138093) 2025-09-30 11:08:50 +02:00
Serhiy Storchaka
1b8dcdacc7
gh-130567: Enable previously skipped locale tests on FreeBSD and macOS (GH-138652) 2025-09-29 17:32:38 +02:00
Hugo van Kemenade
872eafd2b0
gh-76007: Deprecate __version__ attribute (#138675)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-09-29 12:03:23 +03:00
Gordon Messmer
408154d64a
gh-78319: Fix implementation of IMAP APPEND UTF8 (GH-9436)
Make UTF8 support for the IMAP APPEND command RFC 6855 compliant.
2025-09-29 09:03:06 +03:00
Bénédikt Tran
3779f2b95e
gh-139393: fix _CALL_LEN JIT tests for tuples (#139394)
Fix a regression introduced in 7ce25edb8f
where `_PY_NSMALLPOSINTS` was changed from 257 to 1025.
2025-09-28 19:30:44 +02:00
yihong
e18dda96c9
gh-139374: colorize traceback when using timeit command-line interface (#139375)
---------

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-09-28 11:49:18 +00:00
Bénédikt Tran
666112376d
gh-90949: expose Expat API to tune exponential expansion protections (#139368)
Expose the XML Expat 2.7.2 APIs to tune protections against
"billion laughs" [1] attacks.

The exposed APIs are available on Expat parsers, that is,
parsers created by `xml.parsers.expat.ParserCreate()`, as:

- `parser.SetBillionLaughsAttackProtectionActivationThreshold(threshold)`, and
- `parser.SetBillionLaughsAttackProtectionMaximumAmplification(max_factor)`.

This completes the work in f04bea44c3,
and improves the existing related documentation.

[1]: https://en.wikipedia.org/wiki/Billion_laughs_attack
2025-09-28 08:27:04 +00:00
Tian Gao
8288f3693f
gh-139289: Lazy import rlcompleter to fix the refleak (#139305) 2025-09-26 22:17:02 +08:00
Bénédikt Tran
f04bea44c3
gh-90949: add Expat API to prevent XML deadly allocations (CVE-2025-59375) (#139234)
Expose the XML Expat 2.7.2 mitigation APIs to disallow use of
disproportional amounts of dynamic memory from within an Expat
parser (see CVE-2025-59375 for instance).

The exposed APIs are available on Expat parsers, that is,
parsers created by `xml.parsers.expat.ParserCreate()`, as:

- `parser.SetAllocTrackerActivationThreshold(threshold)`, and
- `parser.SetAllocTrackerMaximumAmplification(max_factor)`.
2025-09-26 14:13:56 +00:00
Raymond Hettinger
7909b30493
gh-138682: Add symmetric difference to Counter (gh-138766) 2025-09-26 00:04:49 -05:00
Pablo Galindo Salgado
bc7b511376
gh-138122: Allow to filter by thread in tachyon's flamegraph (#139216) 2025-09-25 15:34:57 +01:00
Jan-Eric Nitschke
2462807b70
gh-138772: Add tests for Turtle.dot() signature (GH-138773) 2025-09-25 16:46:12 +03:00
dgpb
7ce25edb8f
gh-133059: Increase the small positive integer cache to 1024 (GH-133160) 2025-09-24 17:05:30 -04:00
Tian Gao
c8624cd367
gh-138860: Lazy import rlcompleter in pdb to avoid deadlock in subprocess (#139185) 2025-09-24 11:46:05 +08:00