Commit graph

126274 commits

Author SHA1 Message Date
Ned Deily
ce49022b07
gh-131423: Update macOS installer to use OpenSSL 3.0.16. (GH-132189)
Patch by Bénédikt Tran.
2025-04-07 00:46:13 -04:00
Vincent Fazio
4c5dcc6d82
gh-129204: Add _PYTHON_SUBPROCESS_USE_POSIX_SPAWN environment knob (GH-132184)
* Add _PYTHON_SUBPROCESS_USE_POSIX_SPAWN environment knob

Add support for disabling the use of `posix_spawn` via a variable in
the process environment.

While it was previously possible to toggle this by modifying the value
of `subprocess._USE_POSIX_SPAWN`, this required either patching CPython
or modifying it within the interpreter instance which is not always
possible, such as when running applications or scripts not under a
user's control.

Signed-off-by: Vincent Fazio <vfazio@gmail.com>

* fixup NEWS entry

---------

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
2025-04-06 20:53:02 -07:00
Sergey B Kirpichev
6eaa4aeef2
Docs: Add a single table summary for `cmath` (#131887)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-04-07 00:36:21 +01:00
Brian Schubert
e2476398ee
gh-132168: Add __class_getitem__ to ctypes.py_object (#132169) 2025-04-06 22:05:19 +01:00
Emma Smith
0788948dcb
gh-84481: Add ZipFile.data_offset attribute (#132165)
* Add ZipFile.data_offset attribute

This attribute provides the offset to zip data from the start of the file, when available.

* Add blurb-it

* Try fixing class ref in NEWS
2025-04-06 13:51:42 -07:00
Pieter Eendebak
dff8bcfa3c
gh-126703: Add freelist for range and range_iter objects (GH-128619) 2025-04-07 04:40:52 +08:00
Pablo Galindo Salgado
2067378e6d
gh-131591: Handle includes for iOS in remote_debugging.c (#132050) 2025-04-06 21:39:25 +01:00
Tomas R.
a693eaa710
gh-132121: Always escape non-printable characters in pygettext (GH-132122) 2025-04-06 23:15:17 +03:00
Xuehai Pan
7bb1e1a236
gh-132159: Do not shadow user arguments in generated __new__ by @warnings.deprecated (#132160) 2025-04-06 16:37:37 +00:00
sobolevn
c0661df42a
gh-132011: Fix crash on invalid CALL_LIST_APPEND deoptimization (#132018)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-04-06 19:10:39 +03:00
Alex Waygood
42e3a8410b
gh-132139: 3.14 what's new: elaborate on why you can no longer set Union attributes (#132157) 2025-04-06 17:51:05 +02:00
Semyon Moroz
f247e1d04c
gh-131178: Add tests for pickle command-line interface (#131275)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-06 11:50:32 -04:00
Jelle Zijlstra
dbfc6a417a
gh-132139: Document that you can no longer set attributes on unions (#132146) 2025-04-06 13:43:09 +01:00
Kumar Aditya
0dba59e689
gh-128182: add critical sections to ctypes arrays getters and setters (#132152) 2025-04-06 16:21:44 +05:30
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి)
0a10b45dd1
Docs: Replace dead hyperlink for CGI environment variables (#132137) 2025-04-06 10:12:48 +02:00
Nadeshiko Manju
86804003ed
gh-132134: Add the clangd `.cache directory to .gitignore` (#132135)
Signed-off-by: Manjusaka <me@manjusaka.me>
2025-04-06 05:25:08 +01:00
Tomas R.
85bc489b64
GH-131798: Narrow the result of _CONTAINS_OP_SET to bool in the JIT (GH-132057) 2025-04-05 15:56:01 -07:00
Stan Ulbrych
ad6a032ceb
gh-131852: Filter out POT-Creation-Date in msgfmt (GH-131880)
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2025-04-05 22:38:39 +03:00
Rafael Fontenelle
376631829a
Fix numbered list syntax in programming.rst (#130158) 2025-04-05 20:20:21 +01:00
Adam Turner
1755157207
GH-118761: Expose more core interpreter types in `_types` (#132103)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-04-05 18:11:07 +00:00
Ken Jin
92fb949eac
gh-132132: Upgrade LLVM on tail calling CI (GH-132098) 2025-04-06 00:58:23 +08:00
Chris Eibl
d827d4d018
gh-131591: Fix GENERATE_DEBUG_SECTION for clangcl on Windows (GH-132112) 2025-04-06 00:00:54 +08:00
Pieter Eendebak
29772b0647
gh-126703: Add PyCFunction freelist (GH-128692) 2025-04-05 23:51:05 +08:00
Adam Turner
561965fa5c
Generate social media preview cards for the documentation (#132101)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2025-04-05 14:20:06 +00:00
Serhiy Storchaka
ef70f02925
Skip a test for Bluetooth HCI socket (added in GH-132023) if it fails (GH-132072) 2025-04-05 16:41:57 +03:00
Tomas R.
bfc292abc1
Docs: Fix typo in InternalDocs/jit.md (#132119) 2025-04-05 12:36:16 +02:00
Kumar Aditya
b9d8d99563
gh-128182: add critical section to _ctypes.Simple getters and setters (#132081) 2025-04-05 10:27:41 +00:00
Kumar Aditya
f7a8bc50db
gh-128182: add critical section to _ctypes.PyCData methods (#132082) 2025-04-05 15:24:58 +05:30
Semyon Moroz
37bc3865c8
gh-85162: Add HTTPSServer to http.server to serve files over HTTPS (#129607)
The `http.server` module now supports serving over HTTPS using the `http.server.HTTPSServer` class.
This functionality is also exposed by the command-line interface (`python -m http.server`) through the
`--tls-cert`, `--tls-key` and `--tls-password-file` options.
2025-04-05 08:49:48 +00:00
Yuki Kobayashi
99e9798d61
Docs: document plistlib.InvalidFileException (#132069) 2025-04-05 08:46:17 +00:00
Ageev Maxim
05557788f3
gh-131015: Add test for bytes formatting errors (#131881)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-05 10:30:16 +02:00
Prometheus3375
06a110f522
gh-131912: Improve description of grouping options in the format specification docs (#132030)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-05 10:28:50 +02:00
Jelle Zijlstra
ac14d4a23f
gh-129463, gh-128593: Simplify ForwardRef (#129465) 2025-04-05 04:36:34 +00:00
Adam Turner
231a50fa9a
gh-109599: Expose CapsuleType via the _types module (#131969) 2025-04-04 23:37:41 +01:00
Jelle Zijlstra
7473c600a5
gh-131933: Document UnionType/Union merger in What's New (#131941)
Co-authored-by: Alex Waygood
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-04 11:15:31 -07:00
Victorien
ac3a7bfecc
Fix typo in template_replace() test helper docstring (#132094) 2025-04-04 17:38:09 +00:00
Irit Katriel
68e72cf3a8
gh-100239: fix bug in comparison (#132093) 2025-04-04 18:09:49 +01:00
Bénédikt Tran
0a97427ee5
gh-99108: Implement HACL* HMAC (#130157)
A new extension module, `_hmac`, now exposes the HACL* HMAC (formally verified) implementation.

The HACL* implementation is used as a fallback implementation when the OpenSSL implementation of HMAC
is not available or disabled. For now, only named hash algorithms are recognized and SIMD support provided
by HACL* for the BLAKE2 hash functions is not yet used.
2025-04-04 19:04:00 +02:00
Mark Shannon
7099c75550
GH-131498: Cases generator: manage stacks automatically (GH-132074) 2025-04-04 17:59:36 +01:00
Jelle Zijlstra
305be5fb1a
gh-118761: Lazily import annotationlib in typing (#132060)
annotationlib is used quite a few times in typing.py, but I think the
usages are just rare enough that this makes sense.

The import would get triggered by:
- Using get_type_hints(), evaluate_forward_ref(), and similar introspection
  functions
- Using a string annotation anywhere that goes through _type_convert (e.g.,
  "Final['x']" will trigger an annotationlib import in order to access the
  ForwardRef class).
- Creating a TypedDict or NamedTuple (unless it's empty or PEP 563 is on).

Lots of programs will want to use typing without any of these, so the tradeoff
seems worth it.
2025-04-04 08:57:10 -07:00
Bénédikt Tran
04bc681e7c
gh-131938: Update exception message for Element.remove() when an element is not found (#131972)
The exception message for `xml.etree.ElementTree.Element.remove` when an element is not found
has been updated from "list.remove(x): x not in list" to "Element.remove(x): element not found".
2025-04-04 15:04:07 +00:00
Irit Katriel
df59226997
gh-100239: more refined specialisation stats for BINARY_OP/SUBSCR (#132068) 2025-04-04 15:33:31 +01:00
Vincent Fazio
72123063dd
gh-130115: fix thread identifiers for 32-bit musl (#130391)
CPython's pthread-based thread identifier relies on pthread_t being able
to be represented as an unsigned integer type.

This is true in most Linux libc implementations where it's defined as an
unsigned long, however musl typedefs it as a struct *.

If the pointer has the high bit set and is cast to PyThread_ident_t, the
resultant value can be sign-extended [0]. This can cause issues when
comparing against threading._MainThread's identifier. The main thread's
identifier value is retrieved via _get_main_thread_ident which is backed
by an unsigned long which truncates sign extended bits.

  >>> hex(threading.main_thread().ident)
  '0xb6f33f3c'
  >>> hex(threading.current_thread().ident)
  '0xffffffffb6f33f3c'

Work around this by conditionally compiling in some code for non-glibc
based Linux platforms that are at risk of sign-extension to return a
PyLong based on the main thread's unsigned long thread identifier if the
current thread is the main thread.

[0]: https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Arrays-and-pointers-implementation.html

---------

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
2025-04-04 16:31:37 +02:00
Serhiy Storchaka
345baa77ba
gh-132075: Fix possible use of sockaddr structures with uninitialized members (GH-132076)
Now all structure members are initialized with zeroes by default.
2025-04-04 17:09:58 +03:00
Jelle Zijlstra
255eb375a7
gh-118761: Defer import of functools in annotationlib (#132059) 2025-04-04 06:42:22 -07:00
Tomas R.
a126cefc17
gh-130655: Add a test for corrupt .mo files in gettext (#131911) 2025-04-04 13:26:59 +00:00
Tomas R.
16a6270aa6
gh-130655: Add a test for bad magic numbers in .mo files parsed by gettext (#131909) 2025-04-04 13:26:15 +00:00
Tomasz Pytel
891c61c1fa
gh-128632: fix segfault on nested __classdict__ type param (#128744) 2025-04-04 06:23:35 -07:00
Jelle Zijlstra
d1db43c139
gh-105499: Defer "import warnings" in typing (#132061)
A bunch of other warnings in typing.py were already deferred, but
I added a few non-lazy ones.
2025-04-04 06:19:42 -07:00
Chris Eibl
20098719df
GH-131288: Use _AddressOfReturnAddress for MSVC in pycore_ceval.h (gh-131289)
Use `_AddressOfReturnAddress` in `_Py_get_machine_stack_pointer` to silence MSVC warning in pycore_ceval.h for release builds.
2025-04-04 09:03:12 -04:00