Commit graph

35595 commits

Author SHA1 Message Date
Victor Stinner
9eb50a40b4
gh-149879: Fix multiprocessing tests on Cygwin (#150031)
* Disable AF_UNIX connection family on Cygwin.
* forkserver start method is not available on Cygwin: update tests
  for that.
* test_logging calls multiprocessing.get_all_start_methods().
2026-05-19 00:45:35 +02:00
ankhikarmakar
5775aa8e29
gh-149980: Strip all trailing slashes from GNU long directory names in tarfile (GH-150019) 2026-05-18 19:31:15 +00:00
sobolevn
6d5be4b1d6
gh-149977: Fix extra output of -m test test_lazy_import (#149978) 2026-05-18 21:55:27 +03:00
Jeff Epler
806c997f55
gh-140344: ast: Add deprecation warnings (#140345)
These were all deprecated in 3.9 (bace59d8b8) but without
a runtime deprecation warning. Add it now, so that these
items can be removed in 3.21 per PEP 387.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2026-05-18 11:20:49 -07:00
Kumar Aditya
1692854706
gh-149816: fix dict.clear() race on split-table dict with non-embedded values (#149914) 2026-05-18 21:39:45 +05:30
Hugo van Kemenade
f4cb79aa43
gh-146531: Skip hanging wm iconbitmap test on macOS 26 Intel (#148032) 2026-05-18 14:57:02 +00:00
Maurycy Pawłowski-Wieroński
a2932e9c95
gh-149464: Add os.pidfd_getfd(pidfd, targetfd, flags=0) function (#149465)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-05-18 16:29:58 +02:00
Lukas Geiger
18281db0d0
gh-144140: Optimize len for frozen dict/set constants in optimizer (#149969) 2026-05-18 12:20:42 +05:30
Farhan Saif
e62a61177f
gh-146452: Fix pickle segfault on concurrent mutation of dict in pickle (#146470)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-05-17 14:35:27 +05:30
Serhiy Storchaka
1cbe035723
gh-149916: Restore the commented out part of test_body_encode in test_email (GH-149917) 2026-05-17 11:06:35 +03:00
Victor Stinner
a7ed0c9e1d
gh-149879: Fix test_socket on Cygwin (#149913)
Disable SCM_RIGHTS, recvmsg(), sendmsg() and sethostname() on Cygwin.
2026-05-16 10:02:19 +00:00
Victor Stinner
436a6f2894
gh-149879: Fix test_os on Cygwin (#149910) 2026-05-16 10:50:55 +02:00
Victor Stinner
e56ae817e5
gh-149879: Fix test_resource on Cygwin (#149903)
Setting RLIMIT_FSIZE or RLIMIT_CPU fails with EINVAL on Cygwin.
2026-05-15 23:09:36 +00:00
Victor Stinner
c92ef3a6de
gh-149879: Fix test_tarfile on Cygwin (#149897)
On Cygwin, there is no root user (uid 0).

Fix test_realpath_limit_attack(): the test fails with ELOOP on
Cygwin.
2026-05-15 20:49:37 +00:00
Victor Stinner
d9ad171ced
gh-149879: Fix test_signal on Cygwin (#149896)
* Check for SIG_BLOCK instead of pthread_sigmask() to decide if
  SIG_BLOCK, SIG_UNBLOCK and SIG_SETMASK constants should be
  converted to enums.
* Skip ITIMER_VIRTUAL and ITIMER_PROF tests on Cygwin: setitimer()
  fails with ItimerError(EINVAL).
2026-05-15 21:32:10 +02:00
Stan Ulbrych
9ee9f58747
gh-149567: Remove deprecated shutil.ExecError (#149568) 2026-05-15 18:54:05 +01:00
Victor Stinner
c92588efd3
gh-149879: Fix test_pwd on Cygwin (#149880)
On Cygwin, pwd.getpwuid(-1) returns an user ('Unknown+User').
2026-05-15 16:33:46 +00:00
sobolevn
8be3fb1b50
gh-142349: Add help("lazy") support (#149886) 2026-05-15 16:30:40 +00:00
Steve Dower
1c5fe21eb2
gh-149786: Fixes venvlauncher builds on Windows free-threaded (GH-149847) 2026-05-15 14:43:41 +01:00
Victor Stinner
3ecca22567
gh-148675: Use a string for ctypes cparam tag (#149778) 2026-05-15 13:25:09 +02:00
Seth Larson
461b1d9631
gh-149144: Use decodeURIComponent() for UTF-8 support in js_output() (GH-149157) 2026-05-14 23:10:39 +02:00
Zachary Ware
c62c3710dc
gh-124111: Update Windows build to use Tcl/Tk 9.0.3 (GH-149477) 2026-05-14 12:47:28 -05:00
Serhiy Storchaka
c6f7368157
gh-148821: Add more tests for invalid XML encodings (GH-149820) 2026-05-14 13:10:28 +03:00
Gregory P. Smith
eac4fe3b2c
gh-87451: Apply CVE-2021-4189 PASV fix to ftplib.ftpcp() (GH-149648)
ftpcp() called parse227() directly and passed the source server's
self-reported PASV IPv4 address to the target server's PORT command,
bypassing the CVE-2021-4189 fix that was applied only to FTP.makepasv().
A malicious source FTP server could use this to redirect the target
server's data connection to an arbitrary host:port (SSRF).

ftpcp() now uses the source server's actual peer address, honoring the
existing trust_server_pasv_ipv4_address opt-out, the same as makepasv().

Thanks to Qi Ding at Aurascape AI for the report. (GHSA-w8c5-q2xf-gf7c)
2026-05-13 17:33:43 +00:00
Barry Warsaw
b162307d7f
gh-149504: Fix re-entrancy bug when .pth/.start file invokes site.addsitedir() (#149659)
* Add re-entrant tests for gh-149504
* Add end-to-end integration test coverage

This ensures that future whitebox internal test changes do not regress the
public surface semantics.

* Implement a state class to process .pth and .start files

By using this state class and managing implicit and explicit batching, we make it structurally
impossible to get bitten by re-entrant site startup processing.

Fixes #149504
2026-05-13 16:45:25 +00:00
Petr Viktorin
fa81cd976a
gh-140550: Update xxlimited with 3.15 limited API (GH-142827) 2026-05-13 18:35:50 +02:00
Victor Stinner
3cfc249e11
gh-149776: Skip UDP Lite tests if it's not supported (#149777)
Fix test_socket on Linux kernel 7.1 and newer: skip UDP Lite tests if
it's not supported.
2026-05-13 16:55:45 +02:00
Serhiy Storchaka
fa2afa64d9
gh-148821: Add more strict tests for XML encodings (GH-149765)
Exclude encodings like 'utf-8-sig', 'iso2022-jp' and 'hz' from the list of
supported encodings.
2026-05-13 13:40:47 +03:00
Ruben Vorderman
dd94457893
bpo-45509: Check gzip headers for corrupted fields (GH-29028)
Check the header checksum it the HCRC field is present.
2026-05-13 10:20:33 +00:00
scoder
94df62542c
gh-148829: Add PySentinel_CheckExact() (#149725) 2026-05-13 10:10:37 +00:00
John Merkel
cd6096887e
gh-149701: Fully silence potential hash -r error (GH-149702) 2026-05-13 08:59:57 +01:00
Jelle Zijlstra
4087ff8599
gh-149642: Fix interaction between exec and lazy_imports=all (#149643) 2026-05-12 19:59:09 -07:00
Maurycy Pawłowski-Wieroński
76f2285341
gh-149718: Aggregate same stack frames in Tachyon in some collectors (#149719) 2026-05-12 23:46:21 +00:00
sobolevn
e472f6d318
gh-149600: Remove deprecated asyncio.iscoroutinefunction function (#149601) 2026-05-12 22:59:46 +05:30
Shamil
a043b0e875
gh-148701: Add missing test coverage for asyncio.graph (#148702) 2026-05-12 22:57:00 +05:30
Stan Ulbrych
6a0be131c3
gh-149595: Remove the sys._enablelegacywindowsfsencoding() function (#149596)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-05-12 17:11:34 +01:00
sobolevn
0534774a47
gh-149720: Remove support for undotted ext in mimetypes.MimeType.add_type (#149721) 2026-05-12 13:40:21 +00:00
Thomas Kowalski
f5fb491341
gh-149676: Fix hash(frozendict | frozendict) (#149675)
Fix new_dict_impl() to properly initialize ma_hash on frozendict.

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-05-12 10:47:39 +00:00
sobolevn
b546cc10f5
Update mypy to 2.1.0 (#149709) 2026-05-12 08:40:51 +00:00
Mike Edmunds
7a4c6dfb88
gh-128110: Fix rfc2047 whitespace handling in email parser address headers (#130749)
RFC 2047 Section 6.2 requires that "any 'linear-white-space' that
separates a pair of adjacent 'encoded-word's is ignored." The modern
header value parser correctly implements that for unstructured headers,
but had missed a case in structured headers. This could cause a parsed
address header to include extraneous spaces in a display-name.

Switch to @bitdancer's fix from review feedback. Recharacterize space
between ews as fws after parsing in get_phrase.

RDM: This fix is dependent on the fact that "subsequent" atoms will never have
leading whitespace because that's been consumed already. I don't think
it's worth adding extra code for the possibility of leading whitespace
because the parser won't produce it. It's a bit of parser fragility in the
face of code changes, but I think that's a minor concern given the 
parser design (which is that it consumes whitespace greedily)

Co-authored-by: R David Murray <rdmurray@bitdance.com>
2026-05-11 18:20:09 -04:00
Alper
8a4895985f
gh-145235: Make dict watcher API thread-safe for free-threaded builds (gh-145233)
In free-threaded builds, concurrent calls to PyDict_AddWatcher, PyDict_ClearWatcher, PyDict_Watch, and PyDict_Unwatch can race on the shared callback array and the per-dict watcher tags. This change adds a mutex to serialize watcher registration and removal, atomic operations for tag updates, and atomic acquire/release synchronization for callback dispatch in _PyDict_SendEvent.
2026-05-11 11:39:55 -04:00
David Ellis
fadd9bc14e
gh-149614 - Restore deepcopiability of argparse.ArgumentParser instances (#149617)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Savannah Ostrowski <savannah@python.org>
2026-05-11 15:28:23 +00:00
Guo Ci
2d3dec0fbd
gh-140924: In locale module, add missing names to __all__ (GH-140925) 2026-05-11 17:21:03 +03:00
Jelle Zijlstra
56171da341
gh-144957: Fix lazy imports + module __getattr__ (GH-149624) 2026-05-11 15:08:12 +02:00
Michael Droettboom
f23a1837d7
gh-112821: Fix rlcompleter failures on objects with descriptors (#149577)
* gh-112821: Fix rlcompleter failures on objects with descriptors

* Confirm no accesses
2026-05-10 21:44:59 -04:00
Barry Warsaw
197878529f
gh-75723: Fix double evaluation of .pth and .site files in venvs (#149583)
* Idempotent `.pth` execution in `site.addsitedir`
* potentially fix monkeypatch leak?

* fix blind copy paste of recommendation

* Update 2026-03-31-16-15-15.gh-issue-75723.BZ4Rsn.rst

* fix implicit merge conflict with 24c4aecc16

* Add failing tests for gh-75723

Based on @asottle branch !asottle-gh-75723 but refactored for `main`.
This will need a different backport.

* Repair gh-75723

The original fix is here: https://github.com/python/cpython/pull/147951
but I'm refactoring a bit for `main`.

* Refactor _make_mod() so we can use it to create package modules too

* Add myself to CODEOWNERS for the site module

---------

Co-authored-by: anthony sottile <asottile@umich.edu>
Co-authored-by: Filipe Laíns <lains@riseup.net>
2026-05-10 17:25:39 -07:00
sobolevn
c1dbd51fac
gh-149598: Remove strm argument support from logging handlers (#149599)
gh-149598: Remove *strm* argument support from `logging` handlers
2026-05-11 03:05:56 +03:00
Sergey B Kirpichev
c6fd7de64a
gh-149083: use sentinel to fix _functools.reduce() signature (#149591) 2026-05-10 15:22:16 -07:00
ByteFlow
bc1be4f617
gh-148441: Avoid integer overflow in Expat's CharacterDataHandler (#148904)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-05-10 15:42:04 +02:00
Max Schmitt
7241f2739c
gh-149388: Make asyncio PipeHandle.close idempotent (#149518) 2026-05-09 19:44:29 +05:30