Todo.complete(rrule_mode="this_and_future") raises AttributeError; only the undeclared "thisandfuture" works
维护者通常 1 天内回复
评估
调研方向
从 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, raisesAttributeError.rrule_mode="thisandfuture"works. The integration tests use it (tests/test_async_integration.py:1669), and so does thesave-load.todo.recurrences.thisandfuturefeature name. But a type checker rejects it, since it is not in theLiteral.
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 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python-caldav/caldav 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
python-caldav/caldav#792 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
python-caldav/caldav#788 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
python-caldav/caldav#687 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
python-caldav/caldav#829 ·
维护者通常 1 天内回复
-
ical + caldav未关闭
难度 5/5 一周以上 新手友好度 25/100
python-caldav/caldav#825 · 1 条评论 ·
维护者通常 1 天内回复
查看 python-caldav/caldav 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 82/100
btclib-org/btclib-node#2083 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
Gathin23/cleanyourtv#2089 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
jxxghp/MoviePilot#7212 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
cli dx rust
难度 2/5 1-3 小时 新手友好度 85/100
NekomyaDev/nudge#278 ·
维护者通常 1 天内回复