[Python-checkins] CVS: distutils/distutils util.py,1.61,1.62

A.M. Kuchling akuchling@users.sourceforge.net
Wed, 21 Mar 2001 19:03:43 -0800


Update of /cvsroot/python/distutils/distutils
In directory usw-pr-cvs1:/tmp/cvs-serv32511

Modified Files:
	util.py 
Log Message:
Patch #407434: add rfc822_escape utility function


Index: util.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/util.py,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -r1.61 -r1.62
*** util.py	2001/02/27 19:25:42	1.61
--- util.py	2001/03/22 03:03:41	1.62
***************
*** 444,445 ****
--- 444,455 ----
  
  # 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
+ 
+