quopri (quoted-printable) problem

jepler epler jepler.lnk at lnk.ispi.net
Thu Aug 31 21:00:46 EDT 2000


On 31 Aug 2000 19:39:36 +0200, Dieter Maurer
 <dieter at handshake.de> wrote:
>I recognized today, that
>
>  *  Python's "quopri.encode" encodes "=" as "=="
>
>  *  Both Netscape Mail and Outlook Express do
>     not handle an "==" for "=" correctly in
>     some circumstances.

I don't see where rfc1521 permits the use of this method of encoding.
If it were permitted by rfc, I would argue that the other applications
are broken, but if it's not permitted then I would have to agree that
it is Python which is broken.

rfc1521 mentions "=====" as an illegal q-p string; rfc2045 mentions that
having = followed by any character not a hex digit is illegal.

The following pseudo-diff should fix this python problem:

--- quopri.c
def quote(c):
-	if c == ESCAPE:
-		return ESCAPE * 2
	else:
		i = ord(c)
		return ESCAPE + HEX[i/16] + HEX[i%16]



More information about the Python-list mailing list