Todo.complete(rrule_mode="this_and_future") raises AttributeError; only the undeclared "thisandfuture" works
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 66/100
Hướng nghiên cứu
Bắt đầu tại Todo.complete() trong caldav/calendarobjectresource.py, nơi khai báo Literal rrule_mode và nơi cơ chế điều phối getattr tạo ra _complete_recurring_%s. So sánh với phương thức _complete_recurring_thisandfuture gần dòng 2293, rồi kiểm tra _async_complete xem có cùng sự không khớp hay không. Hoàn thành khi rrule_mode="this_and_future" hoạt động, cả hai cách viết đều được chấp nhận và có kiểu dữ liệu, và có unit test bao phủ từng giá trị của Literal.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 412
- Fork
- 113
- Merge trung bình
- 10 giờ 20 phút
- Pull request đã merge (30 ngày)
- 57
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của python-caldav/caldav
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
python-caldav/caldav#792 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
python-caldav/caldav#788 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
python-caldav/caldav#687 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
python-caldav/caldav#817 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
python-caldav/caldav#815 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của python-caldav/caldav
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
AstrBotDevs/AstrBot#10720 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(xiaomi): curated picker list still offers six ids that return 400 (plan-limited vs retired)Đang mởcause/upstream comp/cli P2 provider/other tool/file type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NousResearch/hermes-agent#143900 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
WLAN-Pi/wlanpi-profiler#341 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày