Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Date conversion recipes do not apply errors= handling to parser overflows

未关闭 适合新手
#857 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python, sqlite
领域
database

调研方向

定位 parsedate() 和 parsedatetime() recipe 及其现有测试;先阅读它们如何处理 ParserError 和 errors= 模式。为两个 recipe 添加使用 SET_NULL 和 IGNORE 处理超大数值日期的覆盖,并确认默认行为仍会重新抛出 OverflowError。

由索引模型根据 Issue 内容生成。

描述

parsedate() and parsedatetime() support errors=r.IGNORE and errors=r.SET_NULL for values that cannot be parsed, but they currently only catch dateutil.parser.ParserError.

dateutil.parser.parse() can also raise OverflowError for malformed values with numeric components too large for the underlying date representation. For example:

from sqlite_utils import recipes

value = "999999999999999999999999999999-01-01"
recipes.parsedate(value, errors=recipes.SET_NULL)

Currently this raises OverflowError instead of returning None. The same happens with parsedatetime(), and errors=recipes.IGNORE also fails to return the original value.

A focused fix would treat OverflowError the same as ParserError inside these two recipes while preserving the existing default behavior of re-raising when errors is not set. Targeted tests can cover both recipes and both error-handling modes.

主要语言
Python
星标
2.2k
派生
172
平均合并
9 分钟
30 天内合并 PR
1

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

simonw/sqlite-utils 的其他 Issue

查看 simonw/sqlite-utils 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。