Skip to content

Commit 8b25c0e

Browse files
gh-XXXXX: Fix email.quoprimime.decode() stray CR with eol='\r\n'
decoded[:-1] only strips one character, leaving a stray \r when eol is two characters. Fix: decoded[:-len(eol)].
1 parent 5944a53 commit 8b25c0e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/email/quoprimime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def decode(encoded, eol=NL):
272272
decoded += eol
273273
# Special case if original string did not end with eol
274274
if encoded[-1] not in '\r\n' and decoded.endswith(eol):
275-
decoded = decoded[:-1]
275+
decoded = decoded[:-len(eol)]
276276
return decoded
277277

278278

0 commit comments

Comments
 (0)