Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Parse server iCalendar through vcal.parse_ical() consistently

Aperta
#698 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python

Direzione di ricerca

Start by reading the existing vcal.parse_ical() implementation and its four current call sites, then inspect the server-fed parsing paths named in caldav/jmap/objects/calendar_object.py, caldav/datastate.py and caldav/calendarobjectresource.py. Clarify whether the scope includes vobject parsing, caller-supplied calendars, and a tree-wide enforcement test; done means the agreed server-fed paths use consistent errors without changing the stated malformed-calendar boundary.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

refactoring

Issue below was AI-generated, the introduction has been hand-edited


vcal.parse_ical() was added to handle CalDAV-noise before it would
cause a ValueError exception coming from the icalendar library.
The "CalDAV-noise" can be a body with no iCalendar in it - an empty
scheduling-inbox object, an HTML error page delivered with a 200, a
notification carrying only headers, etc. parse_ical() raises
error.ResponseError instead, quoting what arrived and the URL where
one is known.

It is currently used at four of the parse sites, and there are others that still
hand data to the parser directly. Anything that can be fed by a server should go
through the guard, so the error is the same everywhere.

Sites still parsing directly

  • caldav/jmap/objects/calendar_object.py:64 -
    icalendar.Calendar.from_ical(jscal_to_ical(self.data)). Server-fed: self.data
    is JSCalendar from a JMAP response, so a server that returns something
    unconvertible lands here. This is the one that matters.
  • caldav/datastate.py:140, :192, :228 and
    caldav/calendarobjectresource.py:1612 - vobject.readOne(...). Same data,
    different parser, same problem: an empty body gives a vobject error that says
    nothing about where it came from. A parse_vobject() counterpart, or one guard
    the two share, would cover it.
  • caldav/lib/vcal.py:243 (inside create_ical()) and
    caldav/jmap/convert/ical_to_jscal.py:306 - both parse iCalendar the caller
    supplied, not a server response. Arguably these should keep raising whatever
    icalendar raises, since a broken fragment there is a client-side bug, not a
    server one. Worth deciding explicitly rather than by omission.

Points worth deciding

  • Should the guard fire on the JSCalendar side too - a JMAP response that
    converts to no components at all - or only once it has become iCalendar?
  • parse_ical() is deliberately narrow: it fires only when the body holds no
    BEGIN: line, and hands anything containing a component to icalendar unchanged.
    That boundary should stay wherever it is applied, so that a genuinely malformed
    calendar is not reclassified as a server error.
  • A test that walks the module tree and fails on a bare
    icalendar.Calendar.from_ical( / vobject.readOne( outside the guard would keep
    this from drifting back. Cheap, and the kind of rule that only holds if it is
    enforced.
Lingua principale
Python
Stelle
412
Fork
113
Merge medio
1g 6h
PR unite (30g)
35

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python-caldav/caldav

Tutte le issue di python-caldav/caldav

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.