[Python-3000] should rfc822 accept text io or binary io?
Bill Janssen
janssen at parc.com
Sat Aug 18 01:33:05 CEST 2007
> > What if you've got a PNG as one of the multipart components? With a
> > Content-Transfer-Encoding of "binary"? There's no way to represent that
> > as a string.
>
> Sure is. Any byte sequence can be interpreted as latin-1.
Last time I looked, Latin-1 didn't cover the octets 0x80 - 0x9F.
Maybe you're thinking of Microsoft codepage 1252?
> > I wonder if we're misunderstanding each other here. The "mail
> > message" itself is essentially a binary data structure, not a sequence
> > of strings, though many of its fields consist of carefully specified
> > string values. Is that what you're saying?
>
> I don't think so - I assume Barry really wants to use strings as the
> data type to represent the internal structure. It works fine for all
> aspects except for the 8bit and binary content-transfer-encodings.
Yep, that's what I'm saying -- doing it that way breaks on certain
content-transfer-encodings. There's also a problem with line endings;
the mail standards call for an explicit CRLF sequence.
These things really aren't strings. Few data packets are.
Bill
More information about the Python-3000
mailing list