126200 Commits

Author SHA1 Message Date
Brandt Bucher
1a9d4a1fb3
GH-131798: Allow the JIT to remove more int/float/str guards (GH-131800) 2025-04-01 15:10:15 -07:00
mpage
cd69d55f64
gh-131987: Bump the magic number (#131991)
This should have been done as part of 053c285 but got blown away
in a merge.
2025-04-01 14:53:49 -07:00
Pablo Galindo Salgado
c2ac662f28
gh-131831: Implement PEP 758 – Allow except and except* expressions without parentheses (#131833) 2025-04-01 19:04:56 +00:00
mpage
053c285f6b
gh-130704: Strength reduce LOAD_FAST{_LOAD_FAST} (#130708)
Optimize `LOAD_FAST` opcodes into faster versions that load borrowed references onto the operand stack when we can prove that the lifetime of the local outlives the lifetime of the temporary that is loaded onto the stack.
2025-04-01 10:18:42 -07:00
Chris Eibl
e9556e1004
GH-131296: Disable MSVC-specific optimization in sre.c when compiling with clang-cl (GH-131593) 2025-04-01 17:29:45 +01:00
Bénédikt Tran
edbf7fb129
gh-111178: remove redundant casts for functions with correct signatures (#131673) 2025-04-01 17:18:11 +02:00
Victor Stinner
8cd29c2b53
gh-111178: Fix getsockaddrarg() undefined behavior (#131668)
Don't pass direct references to sockaddr members since their type may
not match PyArg_ParseTuple() types. Instead, use temporary 'int' and
'unsigned char' variables, and update sockaddr members afterwards.

On FreeBSD, treat BTPROTO_HCI node name as a bytes string,
not as an integer.
2025-04-01 13:54:27 +00:00
Will Childs-Klein
3b3720f1a2
gh-131736: only apply security_level workaround in test_ssl for security levels greater than 1 (#131739) 2025-04-01 09:58:47 +02:00
Rafael Fontenelle
23a658b9af
Minor improvements to the programming FAQ (#127261)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-04-01 08:19:06 +01:00
Sergey B Kirpichev
2505573f20
gh-121249: Note struct module changes in What's New (#131867)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-04-01 07:16:36 +00:00
Sergey B Kirpichev
0a3eb8855c
gh-125957: sync argument naming in sphinx docs of the cmath and help() (#125958)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-01 08:16:11 +01:00
Malcolm Smith
fe5c4c53e7
gh-131531: Add android.py package command (#131532)
Adds a `package` entry point to the `android.py` build script to support
creating an Android distribution artefact.
2025-04-01 08:46:29 +08:00
Erlend E. Aasland
45a3ab5a81
gh-129917: Update installers to use SQLite 3.49.1 (#131025)
Co-authored-by: Ned Deily <nad@python.org>
2025-03-31 23:13:17 +02:00
Chris Eibl
2e96f5ae4d
GH-131296: Add missing UNREACHABLE mark in thread_nt.h (GH-131589) 2025-03-31 20:28:35 +01:00
Vincent Fazio
03f6c8e239
gh-131675: Fix mi_atomic_yield in mimalloc on 32-bit ARM (gh-131784)
Use the standard `__ARM_ARCH` macro, which is supported by GCC and Clang.

The branching logic for of `__ARMEL__` has been removed so if the target
architecture supports v7+ instructions, a yield is emitted, otherwise a nop
is emitted. This covers both big and little endian scenarios.

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
2025-03-31 18:29:12 +00:00
stratakis
0cd4befb02
gh-131865: Properly apply exported CFLAGS for dtrace/systemtap builds (#131866)
When using --with-dtrace the resulting object file could be missing
specific CFLAGS exported by the build system due to the systemtap
script using specific defaults.

Exporting the CC and CFLAGS variables before the dtrace invocation
allows us to properly apply CFLAGS exported by the build system
even when cross-compiling.

The fix does not affect the dtrace invocation on Solaris/macOS.
2025-03-31 17:53:49 +00:00
Adam Turner
51e0f2b06c
gh-107369: Optimise `textwrap.indent()` (#131923)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-31 18:31:39 +01:00
Peter Bierma
511d3440a0
gh-131936: Strengthen check in _suggestions._generate_suggestions (#131945) 2025-03-31 19:30:29 +02:00
Jelle Zijlstra
0f511d8b44
gh-105499: typing: Remove an unused function (#131946)
Leftover from #105511 I believe. GitHub code search found no usages other
than copies of typing.py and lists of stdlib functions.
2025-03-31 10:27:03 -07:00
Chris Eibl
9127b4602e
GH-131296: Fix incompatible pointer type warning in _winapi.c (GH-131600) 2025-03-31 17:33:55 +01:00
Chris Eibl
4940d96135
GH-131296: Fix clang-cl warnings on Windows in sqlite3 (GH-131906) 2025-03-31 16:15:31 +01:00
Chris Eibl
7cbcb6efd9
GH-131296: Fix parenthesis warnings on Windows-specific code (GH-131905) 2025-03-31 15:54:30 +01:00
Chris Eibl
cf839c3373
GH-131296: Fix clang-cl warning on Windows in liblzma (GH-131897)
Also removes warnings suppression for MSVC that no longer need to be suppressed.
2025-03-31 15:50:44 +01:00
sobolevn
1e3ec335e0
Fix PEP number in ast_opt.c for new finally check (#131928) 2025-03-31 16:29:23 +03:00
Lukas Geiger
0147be09d5
gh-131525: Remove _HashedSeq wrapper from lru_cache (gh-131922) 2025-03-31 08:23:41 -05:00
Mark Shannon
c535a132e4
GH-131498: Another refactoring of the code generator (GH-131827)
* 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 analyis to optimizer generated code

* Add 'out' parameter to stack.pop
2025-03-31 13:52:48 +01:00
Bénédikt Tran
ba11f45dd9
gh-130843: expose 48-bit timestamp for UUIDv7 (#131838) 2025-03-31 14:32:54 +02:00
Bénédikt Tran
bab1398a47
gh-126033: fix UAF in xml.etree.ElementTree.Element.remove when concurrent mutations happen (#126124) 2025-03-31 12:31:26 +02:00
Bénédikt Tran
c57623c221
gh-126037: fix UAF in xml.etree.ElementTree.Element.find* when concurrent mutations happen (#127964)
We fix a use-after-free in the `find`, `findtext` and `findall` methods of `xml.etree.ElementTree.Element`
objects that can be triggered when the tag to find implements an `__eq__` method that mutates the
element being queried.
2025-03-31 12:26:52 +02:00
Adam Turner
6aa88a2cb3
gh-130167: Optimise `textwrap.dedent()` (#131919)
Co-authored-by: Marius Juston <marius.juston@hotmail.fr>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-31 00:35:12 +00:00
Amit Lavon
685fd74f81
GH-131798: Remove type checks for _TO_BOOL_STR (GH-131816) 2025-03-30 16:07:25 -07:00
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