summaryrefslogtreecommitdiff
path: root/Lib/email/utils.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-30 03:46:43 +0000
committerGuido van Rossum <guido@python.org>2007-08-30 03:46:43 +0000
commit6933bfac37623cbc2f17ef0832ee4d1d22c855c7 (patch)
tree87654f418e405c01f9ab51c43ac847b7936a56e9 /Lib/email/utils.py
parent3d7c8c2f21163d3d829b8cb12e6d220226fc3c80 (diff)
downloadcpython-6933bfac37623cbc2f17ef0832ee4d1d22c855c7.tar.gz
Oops. I copied a slightly older version of the email package from the sandbox.
This should restore the email package in the py3k branch to exactly what's in the sandbox. This wipes out 1-2 fixes made post-copy, which I'll re-apply shortly.
Diffstat (limited to 'Lib/email/utils.py')
-rw-r--r--Lib/email/utils.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/Lib/email/utils.py b/Lib/email/utils.py
index 404cd9698c..5771209c1b 100644
--- a/Lib/email/utils.py
+++ b/Lib/email/utils.py
@@ -71,16 +71,6 @@ def _bdecode(s):
-def fix_eols(s):
- """Replace all line-ending characters with \r\n."""
- # Fix newlines with no preceding carriage return
- s = re.sub(r'(?<!\r)\n', CRLF, s)
- # Fix carriage returns with no following newline
- s = re.sub(r'\r(?!\n)', CRLF, s)
- return s
-
-
-
def formataddr(pair):
"""The inverse of parseaddr(), this takes a 2-tuple of the form
(realname, email_address) and returns the string value suitable
@@ -317,7 +307,7 @@ def collapse_rfc2231_value(value, errors='replace',
# object. We do not want bytes() normal utf-8 decoder, we want a straight
# interpretation of the string as character bytes.
charset, language, text = value
- rawbytes = bytes(ord(c) for c in text)
+ rawbytes = bytes(text, 'raw-unicode-escape')
try:
return str(rawbytes, charset, errors)
except LookupError: