Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đã đóng Phù hợp với người mới
#735 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@muratatar06 đang làm issue này rồi.

Từ ngày 10/10/2026.

  • #736 của @muratatar06 — đang mở

Đá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
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
api

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, 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.

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của python-caldav/caldav

Tất cả issue của python-caldav/caldav

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.