Closed as not planned
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