Aware datetime serialization changes scheduled-message instants by ignoring UTC offsets
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 35/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 2.1k
- Forks
- 821
- Merge moyen
- 9 h 33 min
- PR mergées (30 j)
- 3
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de twilio/twilio-python
-
Docs: "Handling Exceptions" should mention that network errors are not `TwilioRestException`Peut-être pris @henricop l’a pris il y a 13 jours. Ouverte
Difficulté 1/5 1-3 heures Accessibilité débutants 90/100
twilio/twilio-python#986 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Clearer diagnostic when an API Key SID is passed without `account_sid`Peut-être pris @saryeljaramany l’a pris il y a 5 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
twilio/twilio-python#985 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
TokenPagination.next_page_async() makes a sync request and fails with an async http clientPeut-être pris @sebxt l’a pris il y a 31 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
twilio/twilio-python#976 ·
Les mainteneurs répondent en général sous 1 jour
-
AsyncTwilioHttpClient does not JSON-serialize request bodies for application/json endpoints (sync client does) → 400 on JSON-body v2 endpointsPeut-être pris @Steve0x2a l’a pris il y a 77 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
twilio/twilio-python#932 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
twilio/twilio-python#930 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de twilio/twilio-python
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
Les mainteneurs répondent en général sous 1 jour
-
Harden tools/pr_threads.sh: pass all printed thread fields through the deterministic sanitizerOuvertearea:cli area:security enhancement priority:medium size:small
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
RonaldHensbergen/composable-data-stack#1338 ·
Les mainteneurs répondent en général sous 1 jour
-
area:stdlib effort:S impact:med platform:linux type:bug
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
Les mainteneurs répondent en général sous 1 jour
-
automated endpoint-dead needs-curation
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
almanac-data/climate-almanac#139 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
UKGovernmentBEIS/inspect_ai#6695 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour