Skip to content

Instantly share code, notes, and snippets.

@lbt
Created June 27, 2025 20:05
Show Gist options
  • Save lbt/01b5932d80bc1c87eccd0695fe4189f8 to your computer and use it in GitHub Desktop.
Save lbt/01b5932d80bc1c87eccd0695fe4189f8 to your computer and use it in GitHub Desktop.
Radicale bug test case
import datetime
import os
import sys
import caldav # version 1.6.0 or below
# See https://github.com/python-caldav/caldav/issues/439
# This is a minimal test for Radicale server side expansion
# Create a recurring event in Radicale and specify the datetime inside one instance
if __name__ == "__main__":
t_cal = "TV Room" # Calendar name
# Time where there should be just one instance of a recurring event
now = datetime.datetime(2025, 6, 27, 18, 30,
tzinfo=datetime.timezone.utc)
client = caldav.DAVClient(
url=os.environ["CALDAV_URL"], # https://server.example.com:5232/<USER>/"
username=os.environ["CALDAV_USER"], # plain text
password=os.environ["CALDAV_PASSWORD"] # plain text
)
my_principal = client.principal()
for c in my_principal.calendars():
print(f"Found {c.name}")
if c.name == t_cal:
cal = c
evs = cal.search(start=now,
end=now+datetime.timedelta(seconds=1),
event=True,
expand=True,
split_expanded=True)
for ev in evs:
print(f"event: {ev}")
print(f"{ev.data}")
print(f"found {len(evs)} events")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment