diff options
Diffstat (limited to 'Lib/distutils/util.py')
-rw-r--r-- | Lib/distutils/util.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index e596150422..010db9a3b0 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -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 + + |