quopri.encode bug in Python 1.5.2, maybe in 2.0 (?)

François Pinard pinard at iro.umontreal.ca
Mon Feb 19 14:32:43 EST 2001


Hi, people.

I do not have Python 2 handy here, and would like that some kind soul
forwards this report appropriately if the bug still exist in latest versions.

The problem is that `quopri.encode' does not properly handle files which do
not have a line terminator on the last line.  It produces the same result
as if the newline was there.

The proper action in this case is to append a `=' at end of the last produced
line of the `out' file, before the concluding newline, when there was no
end of line to terminate the original, non QP-ed file.  Hmph!  I guess my
explanations are not very clear.  Better a simple example, then! :-)

$ echo a | recode ../qp
a
$ echo -n a | recode ../qp
a=

These matters were clarified to me by Nathaniel Borenstein, the author
of the MIME standard.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard




More information about the Python-list mailing list