Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/email/utils.py

    r2 r391  
    1 # Copyright (C) 2001-2009 Python Software Foundation
     1# Copyright (C) 2001-2010 Python Software Foundation
    22# Author: Barry Warsaw
    33# Contact: email-sig@python.org
     
    6262
    6363def _bdecode(s):
    64     # We can't quite use base64.encodestring() since it tacks on a "courtesy
    65     # newline".  Blech!
     64    """Decodes a base64 string.
     65
     66    This function is equivalent to base64.decodestring and it's retained only
     67    for backward compatibility. It used to remove the last \\n of the decoded
     68    string, if it had any (see issue 7143).
     69    """
    6670    if not s:
    6771        return s
    68     value = base64.decodestring(s)
    69     if not s.endswith('\n') and value.endswith('\n'):
    70         return value[:-1]
    71     return value
     72    return base64.decodestring(s)
    7273
    7374
     
    7576
    7677def fix_eols(s):
    77     """Replace all line-ending characters with \r\n."""
     78    """Replace all line-ending characters with \\r\\n."""
    7879    # Fix newlines with no preceding carriage return
    7980    s = re.sub(r'(?<!\r)\n', CRLF, s)
Note: See TracChangeset for help on using the changeset viewer.