R. David Murray <[email protected]> added the comment:
The behavior you object to is in fact correct per RFC 2046, 5.5.1:
The boundary delimiter MUST occur at the beginning of a line, i.e.,
following a CRLF, and the initial CRLF is considered to be attached
to the boundary delimiter line rather than part of the preceding
part.
So in your example message your attatched file does not in fact have a final
newline. Note that you do not get a newline regardless of whether decode is
true ('p' is the part extracted from your sample message):
>>> p.get_payload()
'MTIzCg=='
>>> p.get_payload(decode=True)
'123'
----------
nosy: +r.david.murray
priority: -> normal
resolution: -> invalid
stage: -> committed/rejected
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue7143>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com