]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-88574: Do not swallow the line after a terminating literal in imaplib (GH-153317)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 8 Jul 2026 11:45:58 +0000 (14:45 +0300)
committerGitHub <noreply@github.com>
Wed, 8 Jul 2026 11:45:58 +0000 (11:45 +0000)
commit6b81784f57c6e7ddef61c8db26bb896b3633dcae
tree0031572d12516e8cb019936447b23d47d8a0080c
parent754b9f28b31e659691e1f3954c9606d0ef064d5d
gh-88574: Do not swallow the line after a terminating literal in imaplib (GH-153317)

GH-152751 skipped a spurious blank line after a literal unconditionally,
corrupting a response that ends with a literal (such as a mailbox name
returned by LIST): its empty trailer was mistaken for the blank and the
following line was swallowed.

The blank is now skipped only inside an unclosed parenthesis.  After a
literal that ends the response it instead arrives before the next
response and is skipped there.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/imaplib.py
Lib/test/test_imaplib.py
Misc/NEWS.d/next/Library/2026-07-01-10-00-00.gh-issue-88574.Kz3wQm.rst