diff options
Diffstat (limited to 'Lib/email/utils.py')
| -rw-r--r-- | Lib/email/utils.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Lib/email/utils.py b/Lib/email/utils.py index b9a7642..6d22ca7 100644 --- a/Lib/email/utils.py +++ b/Lib/email/utils.py @@ -60,14 +60,15 @@ def _identity(s): def _bdecode(s): - # We can't quite use base64.encodestring() since it tacks on a "courtesy - # newline". Blech! + """Decodes a base64 string. + + This function is equivalent to base64.decodestring and it's retained only + for backward compatibility. It used to remove the last \n of the decoded + string, if it had any (see issue 7143). + """ if not s: return s - value = base64.decodestring(s) - if not s.endswith('\n') and value.endswith('\n'): - return value[:-1] - return value + return base64.decodestring(s) |
