You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[doc] mention that flags arg to imaplib's append should be a string #67512
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2015-01-26.12:41:03.391>labels= ['easy', '3.11', 'type-feature', 'docs']
title="[doc] mention that flags arg to imaplib's append should be a string"updated_at=<Date2022-03-01.09:57:22.397>user='https://bugs.python.org/Pilessio'
Indeed, as with much of the early email related code in the stdlib, the documentation assumes way too much familiarity with the relevant RFC...which is really hard to read. We should add a few more details to the docs (like FLAGS being a string) even if we don't have the resources to do a full overhaul.
changed the title [-]Issue with imaplib and append messages passing a tuple with flags[/-][+][doc] mention that flags arg to imaplib's append should be a string[/+]on Nov 27, 2021
You can click "Show Source" on the left of the page to see the .rst page that needs modifying, and can compare with how the following IMAP4.authenticate() method documents arguments.
Patchcheck needs to be run with a version of Python that you've built yourself in the repo.
For a docs change, you can skip this, especially as compiling on Windows is a bit harder to setup. Instead, go ahead and create a PR and we can check what the CI says.
Activity
Pilessio commentedon Jan 26, 2015
In example when appending a message with more than one flag in a tuple with imaplib:
When I have only one flag to append:
Any ideas?
Thanks
ericvsmith commentedon Jan 26, 2015
flags is supposed to be a string. This is not well documented, like much of the module.
Try:
flags = r'(\Answered \Seen)'
bitdancer commentedon Jan 26, 2015
Indeed, as with much of the early email related code in the stdlib, the documentation assumes way too much familiarity with the relevant RFC...which is really hard to read. We should add a few more details to the docs (like FLAGS being a string) even if we don't have the resources to do a full overhaul.
[-]Issue with imaplib and append messages passing a tuple with flags[/-][+][doc] mention that flags arg to imaplib's append should be a string[/+]slateny commentedon Mar 1, 2022
How would this sound as clarification for the flags argument?
flags is a space-separated string containing IMAP flags tokens. Must start with
\.Perhaps optionally also provide the list of system flags as given in https://datatracker.ietf.org/doc/html/rfc3501#section-2.3.2
Rajendra1308 commentedon Dec 24, 2023
Hey! I am a beginner, can someone please tell where exactly the changes have to be made?
hugovk commentedon Dec 25, 2023
@Rajendra1308 The changes should be made to https://docs.python.org/3/library/imaplib.html#imaplib.IMAP4.append
You can click "Show Source" on the left of the page to see the .rst page that needs modifying, and can compare with how the following
IMAP4.authenticate()method documents arguments.See https://devguide.python.org/ for advice on contributing, and https://devguide.python.org/documentation/start-documenting/ for building docs.
Rajendra1308 commentedon Dec 26, 2023
Hey, here's the screenshot of the fix I made and tested in the virtual environment

When I try to run tests, I get this error. Can you please help. It's my first time running tests.

hugovk commentedon Dec 26, 2023
Patchcheck needs to be run with a version of Python that you've built yourself in the repo.
For a docs change, you can skip this, especially as compiling on Windows is a bit harder to setup. Instead, go ahead and create a PR and we can check what the CI says.
Rajendra1308 commentedon Dec 26, 2023
Hey @hugovk Please check the PR and let me know if it's okay, it's the first one, please suggest any changes or provide advice if needed. :)
Rajendra1308 commentedon Dec 27, 2023
Hey @hugovk Please check the new PR and let me know if it's okay, please suggest any changes if needed :)
gh-67512: Document IMAP4.append() flags argument (#149907)
[3.13] gh-67512: Document IMAP4.append() flags argument (GH-149907) (G…
[3.14] gh-67512: Document IMAP4.append() flags argument (GH-149907) (G…
[3.15] gh-67512: Document IMAP4.append() flags argument (GH-149907) (G…