Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

get_calendars() returns [] for a Nextcloud public calendar share (regression from 2.x)

Chiusa
#743 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #744 di @IT-BAER — integrata

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
api

Direzione di ricerca

Start with BaseDAVClient._calendar_home_url(), which falls back to the principal URL when no calendar-home-set is advertised, and compare it with the 2.x behaviour in Principal.calendar_home_set and CalendarSet.children(). Reproduce with the snippet in the issue against a Nextcloud public share URL: get_calendars() should return the shared collection. Done means that case returns the calendar again without breaking the GMX fallback added in d0f1cfa. The issue mentions no test file, so you would need to find the existing discovery tests yourself.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Since 3.0, get_calendars() returns an empty list when the client URL points at a Nextcloud public calendar share. 2.1.0 returns the shared calendar. Home Assistant hit this with 2026.10.0, which moved its CalDAV integration from caldav 2.1.0 to 3.3.0a1: every calendar configured with a public share URL is gone after the update, and nothing is logged.

Server behaviour (Nextcloud, public share)

Client URL: https://<host>/remote.php/dav/public-calendars/<token>

  • PROPFIND Depth 0 on the client URL returns a calendar collection (<d:collection/><cal:calendar/>, displayname, VEVENT/VTODO in supported-calendar-component-set).
  • current-user-principal is /remote.php/dav/principals/system/public/.
  • calendar-home-set on the principal returns 404.
  • PROPFIND Depth 1 on the principal contains no calendar.

What happens in 3.x

BaseDAVClient._calendar_home_url() falls back to the principal URL when no calendar-home-set is advertised (added for GMX in d0f1cfa). The Depth 1 PROPFIND on /principals/system/public/ finds no calendar, so get_calendars() returns [].

In 2.x, Principal.calendar_home_set fell back to client.url, and CalendarSet.children() kept the collection itself, so the share URL worked as the calendar.

Reproduce

from caldav.davclient import DAVClient

c = DAVClient("https://<host>/remote.php/dav/public-calendars/<token>", username="<user>", password="<password>")
print(c.get_principal().get_calendars())
  • caldav 2.1.0: 1 calendar
  • caldav 3.3.0a1: []
  • caldav 3.4.0: []
  • master (fa5ead6): []

Tested against my own Nextcloud with three shared calendars. PR with a fix and tests follows.

Lingua principale
Python
Stelle
412
Fork
113
Merge medio
9h 52m
PR unite (30g)
64

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python-caldav/caldav

Tutte le issue di python-caldav/caldav

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.