Commit 61fe3191 authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

Patch #407434: add rfc822_escape utility function

parent d23ca009
......@@ -443,3 +443,13 @@ byte_compile(files, optimize=%s, force=%s,
(file, cfile_base)
# byte_compile ()
def rfc822_escape (header):
"""Return a version of the string escaped for inclusion in an
RFC-822 header, by adding a space after each newline.
"""
header = string.rstrip(header)
header = string.replace(header, '\n', '\n ')
return header
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