Changeset 391 for python/trunk/Lib/email/utils.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/email/utils.py
r2 r391 1 # Copyright (C) 2001-20 09Python Software Foundation1 # Copyright (C) 2001-2010 Python Software Foundation 2 2 # Author: Barry Warsaw 3 3 # Contact: email-sig@python.org … … 62 62 63 63 def _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 """ 66 70 if not s: 67 71 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) 72 73 73 74 … … 75 76 76 77 def fix_eols(s): 77 """Replace all line-ending characters with \ r\n."""78 """Replace all line-ending characters with \\r\\n.""" 78 79 # Fix newlines with no preceding carriage return 79 80 s = re.sub(r'(?<!\r)\n', CRLF, s)
Note:
See TracChangeset
for help on using the changeset viewer.