-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
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:
if variable 'attachment' is of type email.message.Message
attachment.get_payload(decode=True)
Will yield the base64 content rather than the unecoded content if the sender provides the header 'base64 '
IE
attachment['Content-Transfer-Encoding']
'base64 ' <-notice the extra space
If we adjusted this code
https://github.com/python/cpython/blob/3.12/Lib/email/message.py#L290
to also strip(), this would resolve those edge cases where email clients erroneously add spaces.
This was an actual problem I have run into with a vendor.
CPython versions tested on:
3.9, 3.12
Operating systems tested on:
macOS
Linked PRs
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