Closed seanmills1020 closed 5 months ago
What is "system account" and what is "user account" in this context, and what kind of server do you try to connect to?
Sorry for not responding sooner. The issue was that the account in question had not been created yet.
I have a follow-up question. When you try to authenticate using caldav.DAVClient()
, do you typically wrap this call in a try-except block?
The construct client = caldav.DAVClient()
doesn't initiate any communication by itself, only when you do things like client.principal()
it will try to log in.
The "modern" way to use the DAVClient is to wrap it into a with
-block:
with caldav.DAVClient() as client:
principal = client.principal()
...
It shouldn't matter much, but the with-construct ensures some cleanup is done when the DAVClient
-object is no longer in use.
If you want to catch problems like wrong password, then use a try/except block around the principal call (meta-code, not tested at all and is likely to contain errors):
with caldav.DAVClient() as client:
try:
principal = client.principal()
except caldav.lib.error.AuthorizationError:
print("probably the username/password is incorrect")
raise
try:
calendar = principal.calendar()
calendar.save_event(...)
except caldav.lib.error.DAVError:
print("something went wrong while trying to add the event to the calendar")
raise
Hello,
If I use my account to authenticate, everything is fine. However, if I try to authenticate using the credentials from a system account, I get a
PropfindError
error. Here is the traceback.Maybe the system account doesn’t exist?