Document IMAP4.append() message type and optional arguments
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 35.9k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
The IMAP4.append() documentation currently says only:
Append message to named mailbox.
It now documents the flags argument, but the remaining argument behavior is still easier to discover from Lib/imaplib.py than from the library docs.
In the implementation:
mailboxis treated as optional in practice: a false value is replaced with'INBOX'.flagsanddate_timemay beNone, in which case they are omitted from the command.messageis not optional. It is passed toMapCRLF.sub(CRLF, message), whereMapCRLFis a bytes regular expression, somessagemust be a bytes-like object. Passing astrraisesTypeErrorbefore the command is sent.
The method docstring already hints at this by saying "All args except 'message' can be None", but that detail is not in Doc/library/imaplib.rst.
This is related to the broader documentation issue in #68215, but this issue is intentionally narrower: clarify the public documentation for IMAP4.append() only.
Suggested documentation scope:
- State that message must be a bytes-like object.
- State which arguments may be
None. - Clarify that
mailbox=None(or another false value) usesINBOX. - Clarify that
date_time=Noneomits the internal date argument.
This should stay separate from the existing CR/LF-normalization behavior tracked in #49680.
Linked PRs
- gh-149964
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Apri Doc/library/imaplib.rst e individua la documentazione pubblica di IMAP4.append(). Aggiornala in modo da coprire il requisito che il messaggio sia di tipo bytes-like, quali argomenti possono essere None, il fatto che i valori falsy della mailbox usino INBOX come valore predefinito e che date_time=None ometta l’argomento della data interna; la PR collegata indica che questo lavoro è già in corso.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 25/100