This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: imaplib erronously quotes atoms such as flags
Type: behavior Stage: resolved
Components: email Versions: Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: ZackerySpytz, barry, brightbyte, hynek, r.david.murray
Priority: normal Keywords:

Created on 2012-05-21 09:56 by brightbyte, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg161257 - (view) Author: Daniel Kinzler (brightbyte) Date: 2012-05-21 09:56
imap consideres flags to be atoms, and atoms should not be quoted. Attempting to use a quoted flag with e.g. STORE +FLAGS will cause some servers, like dovecot, to return an error.

However, imaplib apparently auto-quotes all parameters that contain a backslash. This applies to default flags such as \Deleted or \Seen. This results in an error from some IMAP servers.

The reason seems to be that _checkquote method wants to quote anything that matches the _mustquote pattern, and that pattern matches strings containing backslashes.
msg161262 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-05-21 11:32
Interesting.  _checkquote doesn't even exist in the Python3 version of imaplib.
msg367970 - (view) Author: Zackery Spytz (ZackerySpytz) * (Python triager) Date: 2020-05-03 13:49
Python 2 is EOL.
History
Date User Action Args
2022-04-11 14:57:30adminsetgithub: 59074
2020-11-30 10:29:34iritkatrielsetstatus: open -> closed
resolution: out of date
stage: resolved
2020-05-03 13:49:15ZackerySpytzsetnosy: + ZackerySpytz
messages: + msg367970
2012-05-21 11:32:18r.david.murraysetnosy: + barry, r.david.murray
messages: + msg161262
components: + email, - Extension Modules
2012-05-21 10:12:59hyneksetnosy: + hynek
2012-05-21 09:56:51brightbytecreate