diff options
author | Guido van Rossum <guido@python.org> | 2007-08-30 03:46:43 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-08-30 03:46:43 (GMT) |
commit | 9604e66660bfe5066a88e3eb560a5846c620e8de (patch) | |
tree | 445e4bdae6ea20847bdfa014ebdab7a1b7eb2233 /Lib/email/utils.py | |
parent | 2c440a1086e182796a52eeca1fe7c2baa441591d (diff) | |
download | cpython-9604e66660bfe5066a88e3eb560a5846c620e8de.zip cpython-9604e66660bfe5066a88e3eb560a5846c620e8de.tar.gz cpython-9604e66660bfe5066a88e3eb560a5846c620e8de.tar.bz2 |
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.py | 12 |
1 files changed, 1 insertions, 11 deletions
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 _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: |