python / python/cpython

Document IMAP4.append() message type and optional arguments

未關閉
#149,962 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

docs topic-email
主要語言
Python
星號
77.2k
分支
36k
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. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 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 摘要。