diff options
Diffstat (limited to 'Lib/email/header.py')
-rw-r--r-- | Lib/email/header.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/email/header.py b/Lib/email/header.py index c924d3a..89c1391 100644 --- a/Lib/email/header.py +++ b/Lib/email/header.py @@ -94,6 +94,9 @@ def decode_header(header): word = email.quoprimime.header_decode(encoded_string) decoded_words.append((word, charset)) elif encoding == 'b': + paderr = len(encoded_string) % 4 # Postel's law: add missing padding + if paderr: + encoded_string += '==='[:4 - paderr] try: word = email.base64mime.decode(encoded_string) except binascii.Error: |