1. Cyril R
  2. caldav
  3. Issues


Issue #20 on hold


Konrad Kur
created an issue

Hello, my EN is not good ( sorry )

I use caldav library in my application, my problem is cannot save new event in calendar. My traceback, {{{


Traceback (most recent call last): File "test.py", line 26, in <module> event = caldav.Event(client, data = vcal, parent = calendar).save() File "/usr/local/lib/python2.7/dist-packages/caldav/objects.py", line 426, in save path) File "/usr/local/lib/python2.7/dist-packages/caldav/objects.py", line 412, in _create raise error.PutError(r.raw) caldav.lib.error.PutError

}}} My code, {{{


import caldav from caldav.elements import dav, cdav

Principal url

url = "https://nick:pass@mail.****.pl/dav/nick/Calendar/"

vcal = """BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Corp.//CalDAV Client//EN BEGIN:VEVENT UID:20010712T182145Z-123401@example.com DTSTAMP:20060712T182145Z DTSTART:20060714T170000Z DTEND:20060715T040000Z SUMMARY:Bastille Day Party END:VEVENT END:VCALENDAR """

client = caldav.DAVClient(urls) principal = caldav.Principal(client, urls) calendars = principal.calendars()

calendar = calendars[0]

print '\n\n\n\n\n\n'

event = caldav.Event(client, data=vcal, parent=calendar).save() }}} Sorry for my english

Comments (11)

  1. Konrad Kur reporter

    ipython rerturn

    PutError                                  Traceback (most recent call last)
    /home/***/Pulpit/sp/trunk/**/server/<ipython-input-35-d26ca24b0270> in <module>()
    ----> 1 event = caldav.Event(client, data=vcal, parent=calendar).save()
    /usr/local/lib/python2.7/dist-packages/caldav/objects.pyc in save(self)
        424             path = self.url.path if self.url else None
        425             (id, path) = self._create(self._instance.serialize(), self.id,
    --> 426                      path)
        427             self.id = id
        428             self.url = urlparse.urlparse(path)
    /usr/local/lib/python2.7/dist-packages/caldav/objects.pyc in _create(self, data, id, path)
        410             path = url.make(self.parent.url, path)
        411         else:
    --> 412             raise error.PutError(r.raw)
        414         return (id, path)
  2. Cyril R repo owner

    I don't have enough information or context to figure out what the issue is. You should look at the "if" condition that doesn't work and sends you to the "raise".

  3. Log in to comment