projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bc32024
)
Patch #407434: add rfc822_escape utility function
author
Andrew M. Kuchling
<amk@amk.ca>
Thu, 22 Mar 2001 03:03:41 +0000
(
03:03
+0000)
committer
Andrew M. Kuchling
<amk@amk.ca>
Thu, 22 Mar 2001 03:03:41 +0000
(
03:03
+0000)
Lib/distutils/util.py
patch
|
blob
|
history
diff --git
a/Lib/distutils/util.py
b/Lib/distutils/util.py
index e596150422526e531d4fc97c122ec249755ecf9f..010db9a3b0dde606a9680134976694390a8f5560 100644
(file)
--- 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
+
+