Commit Graph

131757 Commits

Author SHA1 Message Date
Victor Stinner 82956594bb Remove unused internal _Py_REF_IS_QUEUED() function (#151236) 2026-06-11 12:54:36 +02:00
Stan Ulbrych 2d3381035d gh-151112: Move an assert that may fail in cfg_builder_check (#151153) 2026-06-11 10:16:27 +01:00
Peter Bierma f9ffca3935 gh-151177: Fix race condition in _testembed (GH-151293) 2026-06-11 11:06:48 +02:00
Stan Ulbrych 9620f69cd4 Drop historical :author:s from HOWTOs (#151091) 2026-06-11 09:46:39 +01:00
tonghuaroot (童话) 84a322aa15 gh-151295: Fix use-after-free in bytes.join()/bytearray.join() via re-entrant __buffer__ (GH-151296) 2026-06-11 07:51:43 +00:00
glennglazer 84630e2cb9 gh-136880: Add warning about PYTHONPATH (GH-151098) 2026-06-11 07:14:34 +01:00
Victorien 871047dbb8 gh-139819: Use builtin sentinel in rlcompleter (GH-151222)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2026-06-10 13:43:09 -07:00
Victor Stinner e60c42dc3f gh-151278: Fix test_faulthandler on UBSan (#151279)
* Py_FatalError() no longer calls _PyFaulthandler_Fini() if it
  doesn't hold the GIL.
* Skip test_faulthandler tests raising signals if run with UBSan.
* Enable test_faulthandler in GitHub Action "Reusable Sanitizer".
2026-06-10 21:39:03 +02:00
Victor Stinner 3a8bebd86f GHA: Display output when a sanitizer test fails (#151268)
Modify GitHub Action "Reusable Sanitizer" to display output when a
test fails: pass -W option.
2026-06-10 19:07:51 +02:00
Victor Stinner 7b6e98911e gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250)
If "import encodings" fails at Python startup, dump the Python path
configuration to help users debugging their configuration. The
encodings module is the first module imported during Python startup.
2026-06-10 18:43:38 +02:00
sobolevn 9fd1a125bc gh-151126: Fix missing memory errors in _interpchannelsmodule.c (#151239) 2026-06-10 18:59:11 +03:00
Serhiy Storchaka ae62b53928 gh-62259: Add Tools/unicode/gen_expat_table.py (GH-150503)
It was used to generate the _expat_decoding_table attribute of CodecInfo.
2026-06-10 18:04:03 +03:00
Petr Viktorin 7bbb9607a2 gh-141984: Reword the Generator expressions section (GH-150518)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-10 16:45:30 +02:00
Kumar Aditya e2bd50d2e1 add asyncio guide for Free-Threaded Python (#150456) 2026-06-10 14:02:11 +00:00
Manoj K M 8c0e2515bb Docs: Fix typos in the "Memory Management" section (GH-151243) 2026-06-10 09:13:17 -04:00
tonghuaroot (童话) 896f7fdc7d gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (#143987)
Fix crashes in socket.sendmsg() and socket.recvmsg_into() that could
occur if buffer sequences are mutated re-entrantly during argument
parsing via __buffer__ protocol callbacks.

The bug occurs because:

1. PySequence_Fast() returns the original list object when the input
   is already a list (not a copy).
2. During iteration, PyObject_GetBuffer() triggers __buffer__
   callbacks which may clear the list.
3. Subsequent iterations access invalid memory (heap OOB read).

The fix replaces PySequence_Fast() with PySequence_Tuple() which
always creates a new tuple, ensuring the sequence cannot be mutated
during iteration.

Co-authored-by: tonghuaroot <23011166+tonghuaroot@users.noreply.github.com>
2026-06-10 13:03:49 +00:00
Bernát Gábor a621e8ad81 gh-89554: Document socket.SocketType as a class (#150683)
socket.SocketType is a class (re-exported from _socket as an alias of
_socket.socket, the base class of socket.socket), but was documented with
the ".. data::" directive, so ":class:" cross-references to it cannot
resolve against a py:class target.

Switch the entry to ".. class::", correct the misleading description
(SocketType is the base class of the socket type, not "type(socket(...))"
which is socket.socket; addresses gh-88427), move it into the Socket
Objects section, and document the socket object methods and attributes
nested under the socket class, dropping the redundant "socket." prefix.
2026-06-10 15:01:01 +02:00
sobolevn 44a533fa1b gh-150671: Deprecate PyAsyncGen_New, PyCoro_New, PyGen_New, PyGen_NewWithQualName functions (#150672)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-10 15:57:09 +03:00
Lukas Geiger f2a0f82282 gh-150988: Fix refleak in OSError when attrs are set before super().__init__() (#150990)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-10 12:27:11 +00:00
Serhiy Storchaka 3ca93ab198 Add yet one assertion in test_set_text_charset_cp949 (GH-151224)
Check bytes(m), not only str(m).
2026-06-10 14:36:14 +03:00
stratakis 3a08e93739 gh-98894: Fix DTrace test_check_probes for shared builds (#151122)
When building with --enable-shared, the SystemTap/DTrace notes
live in libpython. Add detection logic to be used by readelf.

Force the C locale on readelf output.
2026-06-10 13:08:25 +02:00
Serhiy Storchaka 16f71bda3f gh-150285: Wrap long single-line summary in text output in pydoc (GH-151081) 2026-06-10 13:44:35 +03:00
Serhiy Storchaka ca32ebf793 gh-80384: Check that callback is callable at weak reference creation (GH-151145)
* Python functions weakref.ref() and weakref.proxy() now raise TypeError
  if the callback argument is not callable or None.
* C functions PyWeakref_NewRef() and PyWeakref_NewProxy() now raise TypeError
  if the callback argument is not callable, None, or NULL.

Co-authored-by: Maxwell Bernstein <emacs@fb.com>
2026-06-10 13:34:55 +03:00
Taeknology 11c93d6df3 gh-149716: Document PySlot_DATA for Py_mod_gil and Py_mod_multiple_interpreters (GH-150053)
Add short code examples mirroring the existing Py_mod_abi example,
so it is clear which slot definition macro (PySlot_DATA, PySlot_INT64,
or PySlot_UINT64) to use for these two slots.
2026-06-10 12:10:15 +02:00
Harjoth Khara 7a014f44c3 gh-109940: Respect VIRTUAL_ENV_DISABLE_PROMPT in activate.bat (GH-151215) 2026-06-10 09:48:16 +01:00
Bartosz Sławecki ff64d8de66 gh-145239: Colorize case + in the REPL (#150979) 2026-06-10 09:36:50 +03:00
Bartosz Sławecki ce916dc506 gh-150700: Fix class-scope inline comprehensions when nested scopes reference __class__ and friends (#150735)
* Fix class-scope inline comprehensions when nested scopes reference `__class__` and friends

In `inline_comprehension()`, when `__class__` / `__classdict__` /
`__conditional_annotations__` appears as `FREE` in a comprehension's
symbol table because a nested scope captured it (e.g. nested lambdas),
this name is still discarded from `comp_free` unconditionally.

This prevents `drop_class_free()` from seeing it, so the appropriate
`ste_needs_(...)` flag is never set on the enclosing class.
That leads to `codegen_make_closure()` throwing `SystemError` when it
couldn't find `__class__` / `__classdict__` /
`__conditional_annotations__` in the class's cellvars.

From now on we just discard from `comp_free` when no child scope
(e.g. a lambda) still needs the name as `FREE`. When a child scope does
need it, keep it in `comp_free` so `drop_class_free()` can set the
appropriate flag and the class creates the implicit cell.

* Fix tests

* Fix typo

* Fix formatting

* Add test checking validity of `__class__` returned

* Prefer 'used' to 'deferred'
2026-06-09 15:22:13 -07:00
Stan Ulbrych 580499177c gh-151112: Fix double free in assemble_init when out of memory (#151142) 2026-06-09 20:45:54 +01:00
Zachary Ware ab8ebe9034 gh-151163: Update Android, macOS installer, and Windows builds to SQLite 3.53.2 (GH-151187) 2026-06-09 13:27:26 -05:00
Peter 81c1cdcf4a gh-139819: rlcompleter – avoid suggesting attributes not accessible on instances (GH-139820)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2026-06-09 11:00:23 -07:00
Zachary Ware 7053bbd7fd gh-151159: Update CI to use latest SSL library versions (#151176) 2026-06-09 17:29:36 +00:00
Zachary Ware 627dd14346 gh-151159: Bump OpenSSL versions for iOS and Android (GH-151164) 2026-06-09 12:26:13 -05:00
Ivy Xu 720fb82603 gh-151159: Update macOS installer to use OpenSSL 3.5.7. (#151171) 2026-06-09 13:12:36 -04:00
Zachary Ware 6688b0c715 gh-151159: Update Windows builds to use OpenSSL 3.5.7 (GH-151183) 2026-06-09 17:09:19 +00:00
Savannah Ostrowski 82cb7d4bf6 GH-59633: Clarify dest collisions in argparse docs (#150987) 2026-06-09 10:07:03 -07:00
sobolevn 8d94fa7b86 gh-151126: Add missing PyErr_NoMemory in _winapi module (#151154) 2026-06-09 19:42:08 +03:00
Serhiy Storchaka 0fa06f4d7f gh-150285: Fix too long docstrings in the concurrent package (GH-151076) 2026-06-09 19:14:10 +03:00
Serhiy Storchaka ed2b04248a gh-150285: Fix too long docstrings in the asyncio package (GH-151074) 2026-06-09 19:13:34 +03:00
Savannah Ostrowski bc37a227b2 GH-61082: Clarify nargs='*' positional default behavior (#150989) 2026-06-09 15:37:24 +00:00
Savannah Ostrowski 528550e0e7 GH-54732: Tweak wording around empty lines in argument files (#150980) 2026-06-09 15:37:15 +00:00
Sergio López Gómez 3266edefd7 Docs: add cross-references to improve navigation in getpass.rst (#151092) 2026-06-09 11:36:05 -04:00
Robsdedude b2e2cd3912 gh-150898: Assume OpenSSL supports keylogging (#150870)
Since version 3.10, CPython requires OpenSSL 1.1.1 or higher.
Therefore, support for keylogging can be assumed.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-09 16:37:38 +02:00
Stan Ulbrych 0a179e748b Docs: Only add profiling-sampling-visualization.{css,js} to files when necessary (#151150) 2026-06-09 14:16:03 +01:00
sobolevn 9fdbade99e gh-151039: Fix a crash when _datetime types outlive _datetime module (#151044) 2026-06-09 11:44:37 +00:00
Serhiy Storchaka c3cd75afdf gh-151130: Add more tests for PyWeakref_* C API (GH-151131) 2026-06-09 11:11:17 +00:00
Cody Maloney db4b1948bc gh-143008: Fix Null pointer dereferences in TextIOWrapper underlying stream access (#145957)
TextIOWrapper keeps its underlying stream in a member called
`self->buffer`. That stream can be detached by user code, such as custom
`.flush` implementations resulting in `self->buffer` being set to NULL.
The implementation often checked at the start of functions if
`self->buffer` is in a good state, but did not always recheck after
other Python code was called which could modify `self->buffer`.

The cases which need to be re-checked are hard to spot so rather than
rely on reviewer effort create better safety by making all self->buffer
access go through helper functions.

Thank you yihong0618 for the test, NEWS and initial implementation in
gh-143041.

Co-authored-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-09 12:31:44 +02:00
sobolevn 3186547c1e gh-151126: Fix missing PyErr_NoMemory() in remove_unused_consts (#151127) 2026-06-09 10:03:33 +00:00
Arshal Aromal 29a920e80e gh-151070: Fix class referencing typo in collections.abc docs (GH-151088) 2026-06-08 22:38:14 +03:00
Barry Warsaw fccf67a354 gh-150633: Minor improvement of a newly added test (#151103)
Minor improvement of a newly added test.
2026-06-08 19:21:00 +00:00
Thomas Kowalski 54de5475cd gh-150633: Properly handle null characters in the name when importing frozen modules (GH-150634) 2026-06-08 21:31:54 +03:00