diff --git a/CHANGELOG.md b/CHANGELOG.md index ce1445ba..0f48a074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,12 +13,19 @@ This project should more or less adhere to [Semantic Versioning](https://semver. ## [unreleased] -Very minor bugfixes +Some bugfixes. + +I've temporarily disabled testing for python 3.7 and python 3.8. This will be tracked in https://github.com/python-caldav/caldav/issues/332 ### Fixes * Some parts of the library would throw OverflowError on very weird dates/timestamps. Now those are converted to the minimum or maximum accepted date/timestamp. Credits to github user @tamarinvs19 in https://github.com/python-caldav/caldav/pull/327 * `DAVResponse.davclient` was always set to None, now it may be set to the `DAVClient` instance. Credits to github user @sobolevn in https://github.com/python-caldav/caldav/pull/323 +* `DAVResponse.davclient` was always set to None, now it may be set to the `DAVClient` instance. Credits to github user @sobolevn in https://github.com/python-caldav/caldav/pull/323 +* `examples/sync_examples.py`, the sync token needs to be saved to the database (credits to Savvas Giannoukas) +* bugfixes in `set_relations`, credits to github user @Zocker1999NET in https://github.com/python-caldav/caldav/pull/335 and https://github.com/python-caldav/caldav/pull/333 +* dates that are off the scale are converted to `min_date` and `max_date` (and logging en error) rather than throwing OverflowError, credits to github user @tamarinvs19 in https://github.com/python-caldav/caldav/pull/327 +* completing a recurring task with a naïve or floating `DTSTART` would cause a runtime error ## [1.3.6] - 2023-07-20 diff --git a/caldav/objects.py b/caldav/objects.py index 45837ee2..01c19794 100644 --- a/caldav/objects.py +++ b/caldav/objects.py @@ -2580,6 +2580,13 @@ def _next(self, ts=None, i=None, dtstart=None, rrule=None, by=None, no_count=Tru dtstart = ts or datetime.now() else: dtstart = ts or datetime.now() - self._get_duration(i) + ## dtstart should be compared to the completion timestamp, which + ## is set in UTC in the complete() method. However, dtstart + ## may be a naïve or a floating timestamp + ## (TODO: what if it's a date?) + ## (TODO: we need test code for those corner cases!) + if hasattr(dtstart, "astimezone"): + dtstart = dtstart.astimezone(timezone.utc) if not ts: ts = dtstart ## Counting is taken care of other places diff --git a/docs/source/index.rst b/docs/source/index.rst index 2cfc1ce5..a8412631 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -59,9 +59,7 @@ until it's tested. Python2 has been unlikely to work for some time due to lack of testing and due to dependencies on other libraries that doesn't support python2. Python2 is officially not supported starting from version -1.0 - however, code for supporting python2 will only be cleaned -properly away in version 1.1 (and may be postponed if anyone -protests). +1.0. Please report issues if you have problems running the caldav library with old python versions. If it's easy to find a work-around I will @@ -374,7 +372,7 @@ Here are some known issues: * radicale will auto-create a calendar if one tries to access a calendar that does not exist. The normal method of accessing a list of the calendars owned by the user seems to fail. -Some notes on Caldav URLs +Some notes on CalDAV URLs ========================= CalDAV URLs can be quite confusing, some software requires the URL to the calendar, other requires the URL to the principal. The Python CalDAV library does support accessing calendars and principals using such URLs, but the recommended practice is to configure up the CalDAV root URL and tell the library to find the principal and calendars from that. Typical examples of CalDAV URLs: diff --git a/examples/sync_examples.py b/examples/sync_examples.py index 2bd779fb..58c6274f 100644 --- a/examples/sync_examples.py +++ b/examples/sync_examples.py @@ -32,6 +32,7 @@ delete_event_from_database(event) else: update_event_in_database(event) +save_sync_token_to_database(my_updated_events.sync_token) ## USE CASE #2, approach #2, using my_events.sync(). Ref ## https://github.com/python-caldav/caldav/issues/122 this may be @@ -50,6 +51,7 @@ update_event_in_database(event) for event in deleted: delete_event_in_database(event) +save_sync_token_to_database(my_events.sync_token) ## ... but the approach above gets a bit tricky when the server is ## rebooted/restarted. It may be possible to save the etags in the diff --git a/setup.cfg b/setup.cfg index 12cb659d..9d597bc5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,6 @@ [tox:tox] -envlist = py37,py38,py39,py310,py311,docs,style +#envlist = py37,py38,py39,py310,py311,docs,style +envlist = py39,py310,py311,docs,style [testenv] deps = --editable .[test]