python / python/cpython

Document IMAP4.append() message type and optional arguments

Offen
#149,962 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

docs topic-email
Vorherrschende Sprache
Python
Sterne
77.2k
Forks
35.9k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

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:

  • mailbox is treated as optional in practice: a false value is replaced with 'INBOX'.
  • flags and date_time may be None, in which case they are omitted from the command.
  • message is not optional. It is passed to MapCRLF.sub(CRLF, message), where MapCRLF is a bytes regular expression, so message must be a bytes-like object. Passing a str raises TypeError before 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) uses INBOX.
  • Clarify that date_time=None omits the internal date argument.

This should stay separate from the existing CR/LF-normalization behavior tracked in #49680.

Linked PRs
  • gh-149964

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Öffne Doc/library/imaplib.rst und suche die öffentliche Dokumentation für IMAP4.append(). Aktualisiere sie, damit sie die Anforderung an Nachrichten im bytes-like-Format, die Argumente, die None sein dürfen, falsche Mailbox-Werte, die standardmäßig auf INBOX gesetzt werden, sowie date_time=None, wodurch das Argument für das interne Datum weggelassen wird, abdeckt; der verknüpfte PR zeigt, dass diese Arbeit bereits im Gange ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
1/5
Geschätzter Aufwand
Unter einer Stunde
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.