-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-emailtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Issue
collapse_rfc2231_value raises AttributeError: 'tuple' object has no attribute 'startswith' when passed a tuple whose length is not 3. The guard if not isinstance(value, tuple) or len(value) != 3 is meant to handle this case, but falls through to unquote(value) which expects a string.
Reproducer
from email.utils import collapse_rfc2231_value
collapse_rfc2231_value(('a', 'b'))
# AttributeError: 'tuple' object has no attribute 'startswith'CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-emailtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error