| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…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"').
Sorry, something went wrong.
Documentation build overview126 files changed · + 3 added · ± 123 modified + Added ± Modified |
Sorry, something went wrong.
|
I took a look at this while reading through the neighboring imaplib docs. The note seems accurate for current main: IMAP4.select() passes the mailbox argument through _simple_command(), and _command() encodes str arguments to bytes and appends them directly. So a mailbox name containing spaces needs to be quoted by the caller today. Given the related comment on #148770, I wonder whether this should be scoped only to select(), or whether the docs should mention the broader command-argument behavior. There are older/open threads about the general auto-quoting mismatch (#92835, #58148, and PR #6395), and the current docs still describe automatic quoting more generally. So this PR looks useful as a targeted clarification, but maybe it should avoid sounding like select() is the only affected command. |
Sorry, something went wrong.
|
Thank you for the PR. Since GH-152703 imaplib quotes mailbox names automatically, and the documentation paragraph about quoting was updated as part of that change. This is no longer needed. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The IMAP4.select() docs don't mention that mailbox names containing spaces must be quoted by the caller. Since _command() sends arguments as-is (no auto-quoting), a call like M.select('my important mail') sends the space-delimited name to the server, causing errors.
Added a note to the select() method documentation showing the correct usage: M.select('"my important mail"').
Fixes #148770.
📚 Documentation preview 📚: https://cpython-previews--148785.org.readthedocs.build/