From 60b03d2fcde8936303d5212c288f7e367db19549 Mon Sep 17 00:00:00 2001 From: CodeLine9 Date: Mon, 20 Apr 2026 07:23:45 +0800 Subject: [PATCH] gh-148770: Document quoting requirement for IMAP mailbox names with spaces Add a note to IMAP4.select() documenting that mailbox names containing spaces must be quoted by the caller, e.g. M.select('"my important mail"'). --- Doc/library/imaplib.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst index b29b02d3cf5fe8..64cc7ab4c0e394 100644 --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -519,6 +519,12 @@ An :class:`IMAP4` instance has the following methods: (``EXISTS`` response). The default *mailbox* is ``'INBOX'``. If the *readonly* flag is set, modifications to the mailbox are not allowed. + .. note:: + + Mailbox names containing spaces must be quoted by the caller. + For example, to select a mailbox named ``my important mail``, use + ``M.select('"my important mail"')``. + .. method:: IMAP4.send(data)