Commit b387860c authored by Fred Drake's avatar Fred Drake

State that encode() and encodestring() append a newline to the input data

if it does not already end with a newline.
This fixes SF bug #463330.
parent ce608b02
...@@ -40,13 +40,18 @@ Encode the contents of the \var{input} file and write the resulting ...@@ -40,13 +40,18 @@ Encode the contents of the \var{input} file and write the resulting
base64 encoded data to the \var{output} file. base64 encoded data to the \var{output} file.
\var{input} and \var{output} must either be file objects or objects that \var{input} and \var{output} must either be file objects or objects that
mimic the file object interface. \var{input} will be read until mimic the file object interface. \var{input} will be read until
\code{\var{input}.read()} returns an empty string. \code{\var{input}.read()} returns an empty string. If the last input
character is not a newline (\code{'\e n'}), a newline will be added to
the input data.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{encodestring}{s} \begin{funcdesc}{encodestring}{s}
Encode the string \var{s}, which can contain arbitrary binary data, Encode the string \var{s}, which can contain arbitrary binary data,
and return a string containing one or more lines of and return a string containing one or more lines of
base64 encoded data. base64-encoded data. If the last character of \var{s} is not a
newline (\code{'\e n'}), a newline will be added. This causes
\code{encodestring('hello!')} to return the same value as
\code{encodestring('hello!\e n')}.
\end{funcdesc} \end{funcdesc}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment