Kaydet (Commit) df66df0a authored tarafından Andrew M. Kuchling's avatar Andrew M. Kuchling

Patch #407434: add rfc822_escape utility function

üst bc320247
...@@ -443,3 +443,13 @@ byte_compile(files, optimize=%s, force=%s, ...@@ -443,3 +443,13 @@ byte_compile(files, optimize=%s, force=%s,
(file, cfile_base) (file, cfile_base)
# byte_compile () # 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