cpython/Misc
elenril b413bc7a1f
bpo-39100: _header_value_parser: do not treat a Group as invalid-mailbox (#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).
2026-04-30 13:24:23 -04:00
..
mypy gh-131507: Add support for syntax highlighting in PyREPL (GH-133247) 2025-05-02 20:22:31 +02:00
NEWS.d bpo-39100: _header_value_parser: do not treat a Group as invalid-mailbox (#24872) 2026-04-30 13:24:23 -04:00
rhel7 gh-95957: Add instructions for Tcl/Tk and OpenSSL on RHEL/CentOS 7 (#95964) 2022-08-16 13:44:02 +02:00
ACKS gh-96894: Do not turn echo off for subsequent commands in batch activators (GH-96895) 2026-04-13 11:50:46 +00:00
externals.spdx.json gh-144551: Update Windows builds to use OpenSSL 3.5.5 (GH-144796) 2026-02-13 15:43:05 -06:00
HISTORY gh-123492: Remove unnecessary :func: parentheses (#123493) 2024-08-30 14:34:09 +03:00
libabigail.abignore gh-143253: Add libabigail suppression file for internal types (#143254) 2026-01-12 17:37:43 +02:00
platform_triplet.c gh-132026: Ensure _MIPS_SIM has defined _ABI identifiers for comparison (GH-132027) 2025-04-27 21:56:00 +00:00
python-config.in bpo-45101: Add consistency in usage message IO between 2 versions of python-config (GH-28162) 2024-02-26 22:04:44 +02:00
python-config.sh.in gh-116622: Rename build variable MODULE_LDFLAGS back to LIBPYTHON (#122764) 2024-08-09 00:00:55 +02:00
python-embed.pc.in
python.man gh-145649: Fix man page text wrapping for -X option (#145656) 2026-03-16 11:55:00 +01:00
python.pc.in gh-116622: Rename build variable MODULE_LDFLAGS back to LIBPYTHON (#122764) 2024-08-09 00:00:55 +02:00
README gh-145976: Remove Misc/indent.pro (#145992) 2026-03-15 22:29:12 +01:00
README.AIX bpo-42087: Remove support for AIX 5.3 and below (GH-22830) 2020-11-16 16:16:10 +01:00
README.valgrind closes docs: remove references to Py_USING_MEMORY_DEBUGGER (GH-30284) 2021-12-29 16:20:42 -06:00
sbom.spdx.json gh-149017: Upgrade bundled Expat to 2.8.0 (#149020) 2026-04-27 21:22:35 +01:00
SpecialBuilds.txt GH-129763: Remove the LLTRACE macro (GH-129764) 2025-02-07 08:49:51 -08:00
stable_abi.toml gh-146636: PEP 803: Reference documentation (GH-148013) 2026-04-16 14:17:44 +02:00
svnmap.txt
valgrind-python.supp gh-121096: Ignore dlopen() leaks in Valgrind suppression file (#121097) 2024-06-28 13:10:11 +02:00

Python Misc subdirectory
========================

This directory contains files that wouldn't fit in elsewhere.  Some
documents are only of historic importance.

Files found here
----------------

ACKS                    Acknowledgements
HISTORY                 News from previous releases -- oldest last
NEWS.d/                 News files for this release (for some meaning of "this")
python-config.in        Python script template for python-config
python.man              UNIX man page for the python interpreter
python.pc.in            Package configuration info template for pkg-config
README                  The file you're reading now
README.AIX              Information about using Python on AIX
README.valgrind         Information for Valgrind users, see valgrind-python.supp
SpecialBuilds.txt       Describes extra symbols you can set for debug builds
svnmap.txt              Map of old SVN revs and branches to hg changeset ids,
                        help history-digging
valgrind-python.supp    Valgrind suppression file, see README.valgrind