Commit e6a2558c authored by Raymond Hettinger's avatar Raymond Hettinger

Patch 547037. Corrected documentation to match

actual module behavior for adding newlines.
parent cb569477
...@@ -40,21 +40,19 @@ Encode the contents of the \var{input} file and write the resulting ...@@ -40,21 +40,19 @@ 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. If the last input \code{\var{input}.read()} returns an empty string. \function{encode()}
character is not a newline (\code{'\e n'}), a newline will be added to returns the encoded data plus a trailing newline character
the input data. (\code{'\e n'}).
\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. If the last character of \var{s} is not a base64-encoded data. \function{encodestring()} returns a
newline (\code{'\e n'}), a newline will be added. This causes string containing one or more lines of base64-encoded data
\code{encodestring('hello!')} to return the same value as always including an extra trailing newline (\code{'\e n'}).
\code{encodestring('hello!\e n')}.
\end{funcdesc} \end{funcdesc}
\begin{seealso} \begin{seealso}
\seemodule{binascii}{Support module containing \ASCII-to-binary \seemodule{binascii}{Support module containing \ASCII-to-binary
and binary-to-\ASCII{} conversions.} and binary-to-\ASCII{} conversions.}
......
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