在Raspberry Pi

时间:2015-10-20 18:07:13

标签: python calendar raspberry-pi owncloud caldav

概览
我的目标是开发一个在Raspberry Pi上运行的Python应用程序,它通过网络读取OwnCloud日历条目。日历本身是Owncloud的本地安装的一部分,Owncloud驻留在同一本地网络中的另一个Raspberry Pi上。在执行请求时,访问是通过HTTPS完成的,没有激活的SSL身份验证。

问题
我尝试使用 caldav Python包。在使用PIP和Python v2.7安装软件包之后,我得到了Exception: The CalDAV server you are using has a problem with path handling.

这是我在PYTHON IDLE v2.7中输入的内容:

import caldav  
cal_user='user'  
cal_pass='pass'  
cal_url='https://192.168.1.46/remote.php/caldav/calendars/user/pers%C3%B6nlich'  
cal_client=caldav.DAVClient(cal_url, username='user', password='pass', ssl_verify_cert=False)  
cal_principal=cal_client.principal()

这是打印在控制台上的内容:

Warning (from warnings module):
File "C:\PROGS\Python27\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 789
InsecureRequestWarning)
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html

Warning (from warnings module):
File "C:\PROGS\Python27\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 789
InsecureRequestWarning)

InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html

Traceback (most recent call last):
File "<pyshell#9>", line 1, in <module>
cal_principal=cal_client.principal()
File "C:\PROGS\Python27\lib\site-packages\caldav\davclient.py", line 113, in principal
return Principal(self)
File "C:\PROGS\Python27\lib\site-packages\caldav\objects.py", line 307, in __init__
cup = self.get_properties([dav.CurrentUserPrincipal()])
File "C:\PROGS\Python27\lib\site-packages\caldav\objects.py", line 182, 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.

我尽可能地尝试使用网址来消除我身边的任何可能的输入错误,但我仍然不能100%确定我设法做到了。

在我的案例中,有人对最终的异常消息有实际的解释吗?我在哪里可以继续寻找解决问题的方法?

1 个答案:

答案 0 :(得分:2)

我能够重现你的问题。解决方案是从

更改URL中的日历名称

pers%C3%B6nlichpers%c3%b6nlich

请注意BC

的情况