]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-145831: email.quoprimime: `decode()` leaves stray `\r` when `eol='\r\n...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 10 Apr 2026 12:51:34 +0000 (14:51 +0200)
committerGitHub <noreply@github.com>
Fri, 10 Apr 2026 12:51:34 +0000 (08:51 -0400)
commit0530f105ce7e2a60b92006a40e5f426bd80d1b7b
treee3b351586c1c56df7e0203d1d5ff11afd3ca475e
parentfe08867347f5136b05bb8d3b3ef132b2987435f8
[3.13] gh-145831: email.quoprimime: `decode()` leaves stray `\r` when `eol='\r\n'` (GH-145832) (#148311)

decoded[:-1] only strips one character, leaving a stray \r when eol
is two characters. Fix: decoded[:-len(eol)].
(cherry picked from commit 1a0edb1fa899c067f19b09598b45cdb6e733c4ee)

Co-authored-by: Stefan Zetzsche <120379523+stefanzetzsche@users.noreply.github.com>
Lib/email/quoprimime.py
Lib/test/test_email/test_email.py
Misc/NEWS.d/next/Library/2026-03-11-15-09-52.gh-issue-145831._sW94w.rst [new file with mode: 0644]