Comment 21 for bug 505078

Revision history for this message
Martin Pool (mbp) wrote : Re: copy and paste or newline mangling can damage streams

Happy first birthday, bug!

Hooking in a heavyweight mime format is probably possible but turns out to be just a bit difficult, both in terms of defining the grammar, and in hooking it up to Python mime libraries which rather assume they're parsing a mail. It's definitely possible but given I didn't do it in all of last year I probably won't get to it.

So I propose to just do the much smaller fix, which is to tolerate missing \r on the chunk marker lines. The result won't require a change to the grammar and will stay compatible with earlier releases. It doesn't make the stream safe if something is arbitrarily mangling it, but doing so probably requires much stronger encoding (like uuencode) than we really want here. It will make it safer in the case I originally had which is just pasting streams holding plain text attachments into eg temporary files or source files. At any rate I think the current behaviour of crashing with an internal error is not really helping anyone there.