Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

birthdays: .vcf Version 2.x not supported #1370

Open
agschaid opened this issue Nov 18, 2024 · 0 comments
Open

birthdays: .vcf Version 2.x not supported #1370

agschaid opened this issue Nov 18, 2024 · 0 comments

Comments

@agschaid
Copy link
Contributor

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)

@agschaid agschaid changed the title brithdays: .vcf Version 2.x not supported birthdays: .vcf Version 2.x not supported Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant