jelmer / xandikos

A CalDAV/CardDAV server backed by Git
https://www.xandikos.org/
GNU General Public License v3.0
397 stars 40 forks source link

python-caldav users are unable to create calendars #101

Open direnter opened 5 years ago

direnter commented 5 years ago

Steps to Reproduce:

import caldav

#url = "http://localhost:8080"
#url = "http://:@localhost:8080"
url = "http://localhost:8080/user/calendars/calendar/"

client = caldav.DAVClient(url)
principal = client.principal()
principal.make_calendar(name="Test Calendar")

Expected Result: Calendar is created.

Actual Result:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.7/site-packages/caldav/objects.py", line 324, in make_calendar
    return self.calendar_home_set.make_calendar(name, cal_id, supported_calendar_component_set=supported_calendar_component_set)
  File "/usr/lib/python3.7/site-packages/caldav/objects.py", line 335, in calendar_home_set
    chs = self.get_properties([cdav.CalendarHomeSet()])
  File "/usr/lib/python3.7/site-packages/caldav/objects.py", line 192, in get_properties
    raise Exception("The CalDAV server you are using has "
Exception: The CalDAV server you are using has a problem with path handling.
jelmer commented 5 years ago

So the issue here appears to be that python-caldav expects that the principal properties are returned with the principal having a trailing slash.

As discussed on IRC, https://tools.ietf.org/html/rfc4918#section-5.2 requires that collection URLs end with a slash but I can't anything that suggests that principal URLs need to end with a trailing slash or that they should be collections (and thus have a trailing slash for that reason).