python / python/cpython

Document IMAP4.append() message type and optional arguments

オープン
#149,962 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

docs topic-email
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Doc/library/imaplib.rstを開き、IMAP4.append()の公開ドキュメントを見つけてください。メッセージがbytes-likeである必要があること、Noneにできる引数、falsyなメールボックス値がデフォルトでINBOXになること、date_time=Noneによって内部日付の引数が省略されることをカバーするよう更新してください。リンクされたPRは、この作業がすでに進行中であることを示しています。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
documentation
issue の種類
ドキュメント
難易度
1/5
見積もり時間
1時間未満
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。