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.
diff --git a/Lib/email/utils.py b/Lib/email/utils.py
index 404cd96..5771209 100644
--- a/Lib/email/utils.py
+++ b/Lib/email/utils.py
@@ -71,16 +71,6 @@
-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 @@
# 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: