mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
[3.12] gh-100884: email/_header_value_parser: don't encode list separators (GH-100885) (GH-115592)
ListSeparator should not be encoded. This could happen when a long line
pushes its separator to the next line, which would have been encoded.
(cherry picked from commit 09fab93c3d
)
Co-authored-by: Thomas Weißschuh <thomas@t-8ch.de>
This commit is contained in:
parent
068e2190de
commit
9148b77e0a
3 changed files with 9 additions and 1 deletions
|
@ -949,6 +949,7 @@ class _InvalidEwError(errors.HeaderParseError):
|
|||
# up other parse trees. Maybe should have tests for that, too.
|
||||
DOT = ValueTerminal('.', 'dot')
|
||||
ListSeparator = ValueTerminal(',', 'list-separator')
|
||||
ListSeparator.as_ew_allowed = False
|
||||
RouteComponentMarker = ValueTerminal('@', 'route-component-marker')
|
||||
|
||||
#
|
||||
|
@ -2022,7 +2023,7 @@ def get_address_list(value):
|
|||
address_list.defects.append(errors.InvalidHeaderDefect(
|
||||
"invalid address in address-list"))
|
||||
if value: # Must be a , at this point.
|
||||
address_list.append(ValueTerminal(',', 'list-separator'))
|
||||
address_list.append(ListSeparator)
|
||||
value = value[1:]
|
||||
return address_list, value
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue