diff --git a/caldav/__init__.py b/caldav/__init__.py index 319a6eaa..433da774 100644 --- a/caldav/__init__.py +++ b/caldav/__init__.py @@ -11,6 +11,7 @@ "You need to install the `build` package and do a `python -m build` to get caldav.__version__ set correctly" ) from .davclient import DAVClient +from .davclient import get_davclient from .search import CalDAVSearcher ## TODO: this should go away in some future version of the library. @@ -29,4 +30,4 @@ def emit(self, record) -> None: log.addHandler(NullHandler()) -__all__ = ["__version__", "DAVClient"] +__all__ = ["__version__", "DAVClient", "get_davclient"] diff --git a/caldav/lib/url.py b/caldav/lib/url.py index 9feff4ae..44728d1d 100644 --- a/caldav/lib/url.py +++ b/caldav/lib/url.py @@ -189,7 +189,7 @@ def join(self, path: Any) -> "URL": ): raise ValueError("%s can't be joined with %s" % (self, path)) - if path.path[0] == "/": + if path.path and path.path[0] == "/": ret_path = path.path else: sep = "/" diff --git a/caldav/search.py b/caldav/search.py index c8b4a942..e037790f 100644 --- a/caldav/search.py +++ b/caldav/search.py @@ -1,3 +1,4 @@ +import logging from copy import deepcopy from dataclasses import dataclass from dataclasses import field