python / python/cpython

Bad advice in DeprecationWarning about sqlite3 datetime adapter

未關閉
#135,834 0 則留言 12 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

docs topic-sqlite3
主要語言
Python
星號
77.2k
分支
36k
PR 合併指標
PR 指標待擷取

描述

When using the datetime adapter of sqlite3, you'll get:

DeprecationWarning: The default datetime adapter is deprecated as of Python 3.12; see the sqlite3 documentation for suggested replacement recipes

The relevant documentation likely is located at https://docs.python.org/3/library/sqlite3.html#default-adapters-and-converters-deprecated

The suggested recipe likely is https://docs.python.org/3/library/sqlite3.html#sqlite3-adapter-converter-recipes

This recipe suggests modifying global state in the sqlite3 module. This is a no-go for libraries as two libraries registering adapters would quickly run into a conflict.

Please offer a recipe suitable for use in libraries or undeprecate the default adapters.

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 sqlite3 文件中關於預設 adapter 和 converter 的章節,以及 issue 中連結的 adapter/converter recipe 開始。檢查所建議 recipe 的全域註冊是否適用於函式庫程式碼,接著判斷文件是否需要一個對函式庫安全的 recipe,或是否應重新考慮 deprecation。當所要求的指引或關於 deprecation 的決定在 sqlite3 文件和受支援的行為中清楚反映時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
databases, documentation
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。