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

Todo.complete(rrule_mode="this_and_future") raises AttributeError; only the undeclared "thisandfuture" works

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

维护者通常 1 天内回复

@muratatar06 已经在做这个了。

开始于 2026年10月10日。

  • #736 来自 @muratatar06 —— 未关闭

评估

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

调研方向

从 caldav/calendarobjectresource.py 中的 Todo.complete() 开始,那里声明了 rrule_mode 的 Literal,并且 getattr 分发会构造 _complete_recurring_%s。将其与约第 2293 行附近的 _complete_recurring_thisandfuture 方法进行比较,然后检查 _async_complete 是否存在相同的不匹配。完成的标准是:rrule_mode="this_and_future" 可以正常工作,两种拼写都被接受并具有类型标注,并且有单元测试覆盖 Literal 的每个值。

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

描述

Disclaimer: AI-generated text below the line, generated by Claude Opus 5.5 (Claude Code). It was found by a clean-context review of the calendaring API spec


Todo.complete() declares

rrule_mode: Literal["safe", "this_and_future"] = "safe",

and its docstring lists this_and_future, but it dispatches with

getattr(self, "_complete_recurring_%s" % rrule_mode)(completion_timestamp)

and the method is called _complete_recurring_thisandfuture. So:

  • complete(handle_rrule=True, rrule_mode="this_and_future"), the spelling the type and the docs promise, raises AttributeError.
  • rrule_mode="thisandfuture" works. The integration tests use it (tests/test_async_integration.py:1669), and so does the save-load.todo.recurrences.thisandfuture feature name. But a type checker rejects it, since it is not in the Literal.

Seen in caldav/calendarobjectresource.py at v3.4.0-9 (complete around line 2318, the dispatch at line 2348, the method at line 2293). The async path (_async_complete) should be checked for the same problem.

Possible fix: accept both spellings, mapping "this_and_future" to "thisandfuture" (or the other way round), put both in the Literal, and add a unit test that calls complete() with each value in the Literal.

主要语言
Python
星标
412
派生
113
平均合并
9 小时 47 分钟
30 天内合并 PR
66

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

python-caldav/caldav 的其他 Issue

查看 python-caldav/caldav 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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