birthdays: .vcf Version 2.x not supported

Aperta
#1,370 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 7 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
45/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
documentation

Direzione di ricerca

Individua la documentazione relativa ai calendari dei compleanni e alle versioni di vCard accettate. Riproduci l’avviso con l’esempio VERSION:2.1 fornito, quindi documenta la restrizione relativa alla versione supportata e la sintassi TEL prevista o le indicazioni per la conversione. L’attività è completata quando gli utenti possono trovare questo requisito prima di importare vCard meno recenti.

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

Descrizione

Describe the bug
I have a birthdays calendar set up. On startup I get a lot of warning messages on some .vcf files, all of them being version 2.1

If applicable: Stack Trace

Unknown exception happened.
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/icalendar/parser.py", line 237, in from_ical
    key, val = q_split(param, '=', maxsplit=1)
    ^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/icalendar/parser.py", line 344, in parts
    params = Parameters.from_ical(st[name_split + 1: value_split],
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/icalendar/parser.py", line 261, in from_ical
    raise ValueError(
ValueError: 'CELL' is not a valid parameter string: not enough values to unpack (expected 2, got 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/khal/khalendar/khalendar.py", line 398, in _update_vevent
    update(event.raw, href=href, etag=etag, calendar=calendar)
  File "/usr/lib/python3.12/site-packages/khal/khalendar/backend.py", line 273, in update_vcf_dates
    ical = cal_from_ics(vevent_str)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/khal/icalendar.py", line 539, in cal_from_ics
    cal = icalendar.Calendar.from_ical(ics)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/icalendar/cal.py", line 331, in from_ical
    name, params, vals = line.parts()
                         ^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/icalendar/parser.py", line 353, in parts
    raise ValueError(
ValueError: Content line could not be parsed into parts: 'TEL;CELL:0123 456789': 'CELL' is not a valid parameter string: not enough values to unpack (expected 2, got 1)
warning: Skipping birthdays/896e6a13d4101af400deb141455aaaaa.vcf: Content line could not be parsed into parts: 'TEL;CELL:0123 45689': 'CELL' is not a valid parameter string: not enough values to unpack (expected 2, got 1)
warning: This event will not be available in khal.

To Reproduce

  • set up a birthday calendar
  • add a VCard to the card directory that looks like this:
BEGIN:VCARD
VERSION:2.1
N:Mustermann;Max;;;
FN:Max Mustermann
TEL;CELL:0123 456789
UID:896e6a13d4101af400deb141455aaaaa
END:VCARD

Obviously the line TEL;CELL:0123 456789 makes the parser fail. It is correct 2.1 format. In Version 3.x it should look like this: TEL;TYPE=cell:0123 456789

Expected behavior
Actually I don't expect version 2.1 to be supported, since it is pretty old. I for one am going to convert my old vCards to a newer format.

But I think the restriction vCard-Version >= 3.x should be reflected in the documentation (I am sorry if its is and I missed it)

Lingua principale
Python
Stelle
3.1k
Fork
243
Merge medio
12g 8h
PR unite (30g)
6

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 pimutils/khal

Tutte le issue di pimutils/khal

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.