126169 Commits

Author SHA1 Message Date
Bénédikt Tran
39fa19a4cc
gh-131895: fix clang $PATH on Darwin runners for tail-calling interpreter (#131903) 2025-03-30 18:48:00 +00:00
Bénédikt Tran
2c3e3fe54c
Update cryptographic CODEOWNERS entry (#131892)
update cryptographic CODEOWNERS entry
2025-03-30 10:55:05 -07:00
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి)
c432d0147b
gh-127794: Validate email header names according to RFC 5322 (#127820)
`email.message.Message` objects now validate header names specified via `__setitem__`
or `add_header` according to RFC 5322, §2.2 [1].

In particular, callers should expect a ValueError to be raised for invalid header names.

[1]: https://datatracker.ietf.org/doc/html/rfc5322#section-2.2

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: R. David Murray <rdmurray@bitdance.com>
2025-03-30 12:29:29 +00:00
Semyon Moroz
55150a79ca
gh-131178: Update help message for timeit CLI (#131326) 2025-03-30 14:19:38 +03:00
Kumar Aditya
eaffc34d3c
gh-127945: mark TestLocalization as thread unsafe in ctypes (#131899) 2025-03-30 11:08:42 +00:00
Kumar Aditya
46ada1e5e0
gh-127945: acquire critical section around PyCFuncPtr_call (#131898) 2025-03-30 11:01:12 +00:00
Kumar Aditya
28e476f6a2
gh-127945: make initialization of error_object_name thread safe in ctypes (#131896) 2025-03-30 10:50:35 +00:00
Kumar Aditya
bc5a028c13
gh-127945: fix thread safety of creating instances of ctypes structures (#131716) 2025-03-30 15:22:30 +05:30
Adam Dangoor
edfbd8c062
gh-131885: Document that dict.setdefault and dict.get take no keyword arguments (#128208) 2025-03-30 09:22:57 +00:00
Alexander Ershov
044a1e13d5
gh-129994: update docs when using dualstack_ipv6 in socket.create_server (#129996) 2025-03-30 08:19:36 +00:00
Chris Eibl
a175d64e30
GH-129149: Add fast path for medium-sized integers in PyLong_From* functions (#131211)
Add a fast path for medium-sized integers in `PyLong_FromInt{32,64}` and `PyLong_FromUInt{32,64}`.
2025-03-30 10:12:42 +02:00
Jelle Zijlstra
425f60b9eb
gh-130924: Do not create cells for usages of names in local annotations (#131843) 2025-03-29 21:15:48 +00:00
Serhiy Storchaka
c6b1a07343
gh-131853: Fix test_msgfmt on big-endian platforms (GH-131879)
Use a generated .mo file instead of a checked in one.
2025-03-29 19:14:37 +02:00
Stan Ulbrych
fccf9ab33d
gh-131853: Test binary header in msgfmt generated file (GH-131854) 2025-03-29 14:27:50 +02:00
Will Childs-Klein
be2d2181e6
gh-131050: skip test_dh_params when TLS library lacks FFDHE ciphersuites (#131051)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-29 10:31:48 +00:00
Totosuki
a5949986d6
gh-127541: Update os.walk example (GH-127765)
Update os.walk example to be more modern, skip `__pycache__` dirs rather than `CVS` dirs.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-28 23:25:13 -07:00
Martin DeMello
9c1e85fd64
gh-131740: minor readability fix in PyUnstable_GC_VisitObjects (gh-131786)
Minor readability fix in PyUnstable_GC_VisitObjects

Replaces `if (visit_generation())` with `if (visit_generation() < 0)`,
since we are checking for the failure case, and it's confusing to have
that be implicitly `true`.

Also fixes a misspelt variable name.
2025-03-29 08:58:17 +09:00
Dino Viehland
2984ff9e51
gh-130373: Avoid locking in _LOAD_ATTR_WITH_HINT (#130372)
Avoid locking in _LOAD_ATTR_WITH_HINT
2025-03-28 15:16:41 -07:00
Ned Batchelder
00f0771e4d
docs: -I also implies -P (#131539) 2025-03-28 14:59:03 -04:00
Steve Dower
d260631be0
gh-131423: Update to OpenSSL 3.0.16. (GH-131839)
The bin tag is 3.0.16.1 because we rebuilt without uplink support to fix gh-131804.
This PR also prevents making calls that are now unsafe without uplink, and updates
the tests to property interpret these failures as unsupported.
2025-03-28 15:07:57 +00:00
Chris Eibl
ce77da5871
GH-131678: fix Windows tail-call CI does not run the test cases (GH-131690) 2025-03-28 23:00:36 +08:00
Thomas Grainger
adb67ed7e4
gh-131807: fix ResourceWarning in test_ucn.py (#131808)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-28 15:55:40 +01:00
alexey semenyuk
27d1443897
Use assert* comparison methods in test_timer_comparison (#129513) 2025-03-28 14:25:13 +00:00
Bartosz Sławecki
a6cf8275f8
gh-117174: Adapt test_multiple_statements_fail_early to new REPL behavior (follow-up gh-131065) (#131836)
Adapt test to new REPL behavior (follow-up gh-117174)
2025-03-28 15:09:31 +01:00
Kumar Aditya
9752661491
gh-128002: run all asyncio tests with tsan CI (#131797) 2025-03-28 19:30:36 +05:30
Irit Katriel
2c8f329dc6
gh-131738: optimize builtin any/all/tuple calls with a generator expression arg (#131737) 2025-03-28 10:35:20 +00:00
Yan Yanchii
674dbf3b3a
gh-126835: Refine constant folding tests in test_peepholer.py::TestTranforms (#131826) 2025-03-28 10:10:22 +00:00
Hang
8bd88e2827
gh-131818: Add imply -P in -I's help message (#131819) 2025-03-28 08:49:13 +01:00
Victorien
af2afd7c22
gh-119180: Use equality when comparing against annotationlib.Format (#131755) 2025-03-27 21:56:09 -07:00
Thomas Grainger
8a00c9a4d2
gh-128770: raise warnings as errors in test suite - except for test_socket which still logs warnings, and internal test warnings that are now logged (#128973)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-27 21:06:52 +02:00
Brandt Bucher
972a295fe3
GH-130415: Remove redundant sym_matches_type calls in the JIT optimizer (GH-131778) 2025-03-27 09:12:30 -07:00
Wulian233
a096a41b92
gh-128438: Use EnvironmentVarGuard for datetimetester.py to manage environment varibales (#130002) 2025-03-27 18:07:09 +02:00
Semyon Moroz
9b83670f0f
gh-131178: Add tests for tokenize command-line interface (#131274) 2025-03-27 18:04:16 +02:00
Michael Droettboom
8614f86b71
gh-131525: Cache the result of tuple_hash (#131529)
* gh-131525: Cache the result of tuple_hash

* Fix debug builds

* Add blurb

* Fix formatting

* Pre-compute empty tuple singleton

* Mostly set the cache within tuple_alloc

* Fixes for TSAN

* Pre-compute empty tuple singleton

* Fix for 32-bit platforms

* Assert that op != NULL in _PyTuple_RESET_HASH_CACHE

* Use FT_ATOMIC_STORE_SSIZE_RELAXED macro

* Update Include/internal/pycore_tuple.h

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Fix alignment

* atomic load

* Update Objects/tupleobject.c

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-03-27 09:57:06 -04:00
Semyon Moroz
cf5e438c02
gh-118761: Always lazy import re in locale (#129860) 2025-03-27 15:47:08 +02:00
Victor Stinner
3796884528
gh-111178: Skip undefined behavior checks in _PyPegen_lookahead() (#131714)
For example, expression_rule() return type is 'expr_ty', whereas
_PyPegen_lookahead() uses 'void*'.
2025-03-27 10:03:58 +01:00
Victor Stinner
9ef9d687ff
gh-131712: Build _suggestions extension on Windows (#131759)
Add a test checking that the '_suggestions' extension is available.
2025-03-27 09:53:39 +01:00
Mark Shannon
d836d287a7
GH-131729: Consider in-memory state when merging storage and stack (GH-131773) 2025-03-27 08:32:45 +00:00
Neil Schemenauer
316938bddf
Revise pycore_stackref.h comments. (#130601) 2025-03-27 14:00:25 +05:30
Neil Schemenauer
c824d8e6f9
gh-131782: Fix cast to match type of bits in _Py_TryIncrefCompareStackRef (#131783) 2025-03-27 13:58:59 +05:30
Sergey Muraviov
151d1bfd1b
gh-131763: Replace the redundant check with assert in remove_tools (#131765) 2025-03-26 18:36:04 -04:00
Simon Legner
52b5eb95b7
gh-131236: allow to generate multiple UUIDs at once via CLI (#131218)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-26 22:49:28 +02:00
Brandt Bucher
4b3d5b6042
GH-119866: Don't clear frame->stackpointer on release builds (GH-131750) 2025-03-26 19:00:16 +00:00
rialbat
2c686a9ac2
gh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with a NULL value (#131764) 2025-03-26 18:44:56 +00:00
Sam Gross
67fbfb42bd
gh-131586: Avoid refcount contention in some "special" calls (#131588)
In the free threaded build, the `_PyObject_LookupSpecial()` call can lead to
reference count contention on the returned function object becuase it
doesn't use stackrefs. Refactor some of the callers to use
`_PyObject_MaybeCallSpecialNoArgs`, which uses stackrefs internally.

This fixes the scaling bottleneck in the "lookup_special" microbenchmark
in `ftscalingbench.py`. However, the are still some uses of
`_PyObject_LookupSpecial()` that need to be addressed in future PRs.
2025-03-26 14:38:47 -04:00
Sam Gross
3d4ac1a2c2
gh-123358: Use _PyStackRef in LOAD_DEREF (gh-130064)
Concurrent accesses from multiple threads to the same `cell` object did not
scale well in the free-threaded build. Use `_PyStackRef` and optimistically
avoid locking to improve scaling.

With the locks around cell reads gone, some of the free threading tests were
prone to starvation: the readers were able to run in a tight loop and the
writer threads weren't scheduled frequently enough to make timely progress.
Adjust the tests to avoid this.

Co-authored-by: Donghee Na <donghee.na@python.org>
2025-03-26 12:08:20 -04:00
Mark Shannon
1b8bb1ed0c
GH-131729: Code-gen better liveness analysis (GH-131732)
* Rename 'defined' attribute to 'in_local' to more accurately reflect how it is used

* Make death of variables explicit even for array variables.

* Convert in_memory from boolean to stack offset

* Don't apply liveness analysis to optimizer generated code

* Fix RETURN_VALUE in optimizer
2025-03-26 15:21:35 +00:00
Idan Noiman
b9ca438daa
gh-131741: Add documentation for Windows version detection change in platform (#131742)
Document the behavior change between 3.11 & 3.12, where ``platform`` now correctly detects Windows 11 and Windows Server releases past Windows Server 2012.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Wulian <1055917385@qq.com>
2025-03-26 14:50:37 +00:00
Thomas Grainger
2d83891dfd
gh-131649: fix test_string_literals SyntaxWarning (#131650) 2025-03-26 15:01:18 +01:00
Sam Gross
5abff6960b
gh-117657: Fix data race in compare_unicode_unicode_threadsafe (gh-131746)
We can't safely check the type of the found key until we incref it or if we know that it's immortal.
2025-03-26 09:01:57 -04:00