geier / pycarddav

DEPRECATED - use vdirsyncer & khard -- easy to use CLI CardDAV client

Home Page:http://lostpackets.de/pycarddav

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`upload_new_vcard` results in 405 error with Baïkal 0.2.7

equaeghe opened this issue · comments

I'm trying to use pycarddav for a one-time upload of my vcards to a Baïkal 0.2.7 server. I'm using it in an IPython console and can connect to the server using the PyCardDAV object. With this object, I can do get_vcard, delete_vcard, and update_vcard without problems. However, when I try to upload_new_card, I get a 405 error:

HTTPError                                 Traceback (most recent call last)
<ipython-input-17-590b242bf088> in <module>()
----> 1 p.upload_new_card(s)

/home/equaeghe/.local/lib64/python2.7/site-packages/pyCardDAV-0.7.0-py2.7.egg/pycarddav/carddav.pyc in upload_new_card(self, card)
    214 
    215                 return (parsed_url.path, etag)
--> 216         response.raise_for_status()
    217 
    218     def _get_xml_props(self):

/home/equaeghe/.local/lib64/python2.7/site-packages/requests-2.5.1-py2.7.egg/requests/models.pyc in raise_for_status(self)
    829 
    830         if http_error_msg:
--> 831             raise HTTPError(http_error_msg, response=self)
    832 
    833     def close(self):

HTTPError: 405 Client Error: Method Not Allowed

I guess upload_new_vcard uses some method that is unsupported by Baïkal, but this seems strange to me, as Baïkal is reputed to be supported and I did not find any reports like mine.

What can I do to get at the bottom of this issue and hopefully resolve it?

Ok. I looked at my server logs and found the cause: I had forgotted the trailing / in my resource argument to PyCardDAV. Adding it resolved the issue.

Sorry for the noise.