【发布时间】:2015-10-20 18:07:13
【问题描述】:
概览
我的目标是开发一个在 Raspberry Pi 上运行的 Python 应用程序,它可以通过网络读取 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.
我已尝试尽可能多地使用 URL 以消除任何可能的输入错误,但我仍然不能 100% 确定我是否做到了。
有人对我的案例中的最终异常消息有实际的解释吗?我可以在哪里继续寻找解决问题的方法?
【问题讨论】:
-
当你运行它时服务器日志会说什么? 404? 403?
-
在哪里可以找到日志?
标签: python calendar raspberry-pi owncloud caldav