Aware datetime serialization changes scheduled-message instants by ignoring UTC offsets
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
- 35/100
Hướng nghiên cứu
Read the handwritten twilio.base.serialize.iso8601_datetime serializer and the public-client tests for scheduled messages. Reproduce the two timezone-offset cases through the mocked HTTP transport, then check that naive datetimes, date-only values, preformatted strings, and the unset sentinel retain their existing behavior. Done means aware datetimes serialize to the correct UTC instant; the issue reports that pull request #981 is already open.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Issue
The handwritten twilio.base.serialize.iso8601_datetime formats timezone-aware datetimes with strftime("%Y-%m-%dT%H:%M:%SZ") without converting their timezone to UTC. This changes the represented instant when the datetime has a nonzero UTC offset.
Through the public client (mocked HTTP transport), Client(...).messages.create(..., schedule_type="fixed", send_at=datetime(2030, 1, 2, 1, 30, tzinfo=timezone(timedelta(hours=5, minutes=30)))) currently sends SendAt=2030-01-02T01:30:00Z. It should send 2030-01-01T20:00:00Z. Negative offsets can similarly cross the next day. Twilio's scheduling timestamp documentation calls for a UTC ISO8601 timestamp.
Proposed fix and validation
Convert aware datetimes to UTC before adding the Z suffix. Keep naive datetimes, date-only values, preformatted strings and the unset sentinel's existing behavior. This touches the handwritten shared serializer, not generated REST methods.
Two public-client timezone cases fail before the fix; four controls pass. Afterward the full required make test workflow passes:647 tests, both Flake8 runs, Autoflake and Black (797 files). Tested Python3.12; no real messages or live Twilio requests, and no full Python matrix. AI-assisted contribution, maintainer review pending.
- Ngôn ngữ chính
- Python
- Star
- 2.1k
- Fork
- 821
- Merge trung bình
- 9 giờ 33 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- 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 twilio/twilio-python
-
Docs: "Handling Exceptions" should mention that network errors are not `TwilioRestException`Có thể đã có người làm @henricop đã nhận 13 ngày trước. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
twilio/twilio-python#986 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Clearer diagnostic when an API Key SID is passed without `account_sid`Có thể đã có người làm @saryeljaramany đã nhận 5 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
twilio/twilio-python#985 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
TokenPagination.next_page_async() makes a sync request and fails with an async http clientCó thể đã có người làm @sebxt đã nhận 31 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
twilio/twilio-python#976 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
AsyncTwilioHttpClient does not JSON-serialize request bodies for application/json endpoints (sync client does) → 400 on JSON-body v2 endpointsCó thể đã có người làm @Steve0x2a đã nhận 77 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
twilio/twilio-python#932 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
twilio/twilio-python#930 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của twilio/twilio-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Harden tools/pr_threads.sh: pass all printed thread fields through the deterministic sanitizerĐang mởarea:cli area:security enhancement priority:medium size:small
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
RonaldHensbergen/composable-data-stack#1338 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:stdlib effort:S impact:med platform:linux type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
automated endpoint-dead needs-curation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
almanac-data/climate-almanac#139 ·
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 82/100
UKGovernmentBEIS/inspect_ai#6695 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày