Config: a single CALDAV_* variable makes the config file be ignored
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- developer-experience
Direzione di ricerca
Start in caldav/config.py: get_connection_params() returns the CALDAV_* environment as soon as one connection key is present, and read_config() calls yaml.load with yaml.Loader near line 108. Then check get_calendars() in caldav/base_client.py near line 1069, which calls get_davclient(check_config_file=False). Done when env values override the selected file section key by key, an env URL still wins, the search order matches docs/source/configfile.rst, and yaml.safe_load is used. Item 2 needs a maintainer decision on which order to keep.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Disclaimer: AI-generated text below the line, generated by Claude Opus 5.5 (Claude Code), from the prompts:
Please check how the caldav implementation works today. [the config-file handling, while working on https://github.com/pycalendar/calendaring/blob/main/docs/design/CONFIGURATION_PROPOSAL.md]
Please file an issue about the config inconsistencies in the caldav library
Found while specifying the shared config file for calendaring (CONFIGURATION_PROPOSAL.md), checked against master 0f2ee414.
1. Environment variables replace the config file instead of overriding it
get_connection_params() (caldav/config.py) returns the CALDAV_* environment as soon as there is one connection key in it, without merging it with the file. So a user who keeps the password out of the file:
# ~/.config/caldav/calendar.yaml
default:
caldav_url: https://dav.example.com/
caldav_username: alice
CALDAV_PASSWORD=secret python -c 'from caldav.config import get_connection_params; print(get_connection_params())'
# {'password': 'secret'}
gets no URL at all, and get_davclient() then returns a client with the URL https://.
get_calendars() does the same for a multi-section name: it calls get_davclient(check_config_file=False, …) first (caldav/base_client.py, around line 1069), so any CALDAV_* connection variable replaces a config_section="*" or contains: expansion with one env-only client.
calendaring-jmap does what one would expect: an env URL means the file is not read, otherwise the env values override the file key by key.
Suggested fix: if the environment holds a URL, keep today's behaviour; otherwise apply the env values on top of the selected section. For a name that expands to several sections, apply only an env URL (one connection replacing the expansion), and ignore the other env values.
2. The documented search order differs from the code
docs/source/configfile.rst lists /etc/caldav/calendar.conf before /etc/calendar.conf; read_config() tries /etc/calendar.conf first. One of them should change (the code order is probably what users have now).
3. YAML is parsed with yaml.Loader
read_config() uses yaml.load(config_file, yaml.Loader) (caldav/config.py line 108), which constructs arbitrary Python objects from tags. Config files are searched in /etc/ too, and will be shared with other pycalendar tools. yaml.safe_load would do; nothing in the documented format needs tags.
- Lingua principale
- Python
- Stelle
- 412
- Fork
- 113
- Merge medio
- 1g 2h
- PR unite (30g)
- 43
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di python-caldav/caldav
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
python-caldav/caldav#687 ·
I maintainer di solito rispondono entro 1 giorno
-
compatibility refactoring
Difficoltà 4/5 3-5 giorni Idoneità per principianti 32/100
python-caldav/caldav#778 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Support for ical objectsAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
python-caldav/caldav#777 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
python-caldav/caldav#774 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
python-caldav/caldav#769 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di python-caldav/caldav
Issue simili
-
area:core-platform effort:S priority:P3 status:in-review type:test
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 80/100
randomparity/kdive#3246 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Requantification library converts m/z to mass with the hydrogen-atom mass instead of the proton massApertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
nf-core/metaboigniter#130 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
common-workflow-language/cwl-utils#477 ·
I maintainer di solito rispondono entro 1 giorno
-
Add dependabotApertafeat
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 72/100
open-nudge/opentemplate#204 ·
I maintainer di solito rispondono entro 1 giorno
-
github-stale-ci-pr-closer: KV state is double-wrapped, never persists, and hits the depth-32 limitForse già presa @VascoSch92 l’ha presa oggi. Apertapriority:medium ready-for-dev
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
OpenHands/extensions#781 ·
I maintainer di solito rispondono entro 1 giorno