Skip to content

[pull] main from python:main#1011

Merged
pull[bot] merged 7 commits intotj-python:mainfrom
python:main
Apr 30, 2026
Merged

[pull] main from python:main#1011
pull[bot] merged 7 commits intotj-python:mainfrom
python:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Apr 30, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

efroemling and others added 7 commits April 30, 2026 09:27
…)` (GH-149106)

Add a keyword-only `max_threads` argument to `dump_traceback()` and
`dump_traceback_later()`, defaulting to 100 to preserve existing
behavior. Allows server processes with many worker threads to dump
beyond the historical 100-thread cap (previously a hardcoded
`MAX_NTHREADS = 100` in `Python/traceback.c`).

The cap matters in practice: tstates are prepended to the
PyInterpreterState linked list, so the dump walks newest-first. With
more than 100 threads alive, the main thread (oldest, at the tail) is
silently elided from watchdog dumps -- exactly the thread that's
usually wanted.

The hardcoded value is moved to a new internal macro
`_Py_TRACEBACK_MAX_NTHREADS` in `pycore_traceback.h` so the in-tree
fatal-signal callers all reference one source of truth.
This C API is not part of the limited C API, so move it to the
CPython C API.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: donBarbos <donbarbos@proton.me>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
- Use lazy import for regular expressions.
- Use frozendict for string escapes

Co-authored-by: Taneli Hukkinen <hukkinen@eurecom.fr>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
…box (#24872)

When an address in an address-list has garbage at the end, the code will
currently:

1. change the mailbox in the last parsed address into invalid-mailbox by
   overriding its token_type;
2. wrap the trailing garbage into another invalid-mailbox and append it
   to the last parsed address.

However, that does not take into account that an address may
also contain a Group instead of a single mailbox. In that case,
overwriting token_type leads to undesirable results, e.g. parsing an
email with the following 'To' header:

unlisted-recipients:; (no To-header on input)

raises an AttributeError from trying to treat the Group as a Mailbox.

Moreover it is questionable whether the previously parsed mailbox should
be treated as invalid in addition to the trailing garbage.

Address both of the above by wrapping the trailing garbage in a new
Address with a single invalid-mailbox, and append it to the AddressList
directly.

Changes the results of the
test_get_address_list_mailboxes_invalid_addresses test, where the
address list is now parsed into 4 mailboxes instead of 3 (all but the
first one are invalid).
@pull pull Bot locked and limited conversation to collaborators Apr 30, 2026
@pull pull Bot added the ⤵️ pull label Apr 30, 2026
@pull pull Bot merged commit b413bc7 into tj-python:main Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants