summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/imaplib.py5
-rw-r--r--Misc/NEWS4
2 files changed, 9 insertions, 0 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py
index 3f6656a..ad5f4e9 100644
--- a/Lib/imaplib.py
+++ b/Lib/imaplib.py
@@ -1063,6 +1063,11 @@ class IMAP4:
del self.tagged_commands[tag]
return result
+ # If we've seen a BYE at this point, the socket will be
+ # closed, so report the BYE now.
+
+ self._check_bye()
+
# Some have reported "unexpected response" exceptions.
# Note that ignoring them here causes loops.
# Instead, send me details of the unexpected response and
diff --git a/Misc/NEWS b/Misc/NEWS
index fb4a368..bf7781f 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -45,6 +45,10 @@ Core and Builtins
Library
-------
+- Issue #20013: Some imap servers disconnect if the current mailbox is
+ deleted, and imaplib did not handle that case gracefully. Now it
+ handles the 'bye' correctly.
+
- Issue #19920: TarFile.list() no longer fails when outputs a listing
containing non-encodable characters. Based on patch by Vajrasky Kok.