diff options
author | Raymond Hettinger <python@rcn.com> | 2011-03-23 12:53:32 -0700 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2011-03-23 12:53:32 -0700 |
commit | 41da10e62cfa2fee9c651d0d613a6f6998bf6f2c (patch) | |
tree | 50897c71d9ac469c30cb0d0e8fa8817e3623f567 /Lib/email/quoprimime.py | |
parent | 2ebea41d315bb42a6d6983137bf5fdb01d3f1a95 (diff) | |
parent | 5839b9635cd582a5a2660605a48bddafab44aa06 (diff) | |
download | cpython-git-41da10e62cfa2fee9c651d0d613a6f6998bf6f2c.tar.gz |
Merge
Diffstat (limited to 'Lib/email/quoprimime.py')
-rw-r--r-- | Lib/email/quoprimime.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/email/quoprimime.py b/Lib/email/quoprimime.py index 168dfffa47..bffad4efa3 100644 --- a/Lib/email/quoprimime.py +++ b/Lib/email/quoprimime.py @@ -135,9 +135,9 @@ def header_encode(header_bytes, charset='iso-8859-1'): charset names the character set to use in the RFC 2046 header. It defaults to iso-8859-1. """ - # Return empty headers unchanged + # Return empty headers as an empty string. if not header_bytes: - return str(header_bytes) + return '' # Iterate over every byte, encoding if necessary. encoded = [] for octet in header_bytes: @@ -268,7 +268,7 @@ def decode(encoded, eol=NL): if i == n: decoded += eol # Special case if original string did not end with eol - if not encoded.endswith(eol) and decoded.endswith(eol): + if encoded[-1] not in '\r\n' and decoded.endswith(eol): decoded = decoded[:-1] return decoded |