diff --git a/radicale/__main__.py b/radicale/__main__.py index 2e1a9024..209348f1 100644 --- a/radicale/__main__.py +++ b/radicale/__main__.py @@ -29,11 +29,11 @@ import os import signal import socket import sys +from types import FrameType from typing import List, Optional, cast from radicale import VERSION, config, log, server, storage, types from radicale.log import logger -from types import FrameType def run() -> None: diff --git a/radicale/app/base.py b/radicale/app/base.py index c7cf4148..4faf52d1 100644 --- a/radicale/app/base.py +++ b/radicale/app/base.py @@ -21,13 +21,12 @@ import sys import xml.etree.ElementTree as ET from typing import Optional -# HACK: https://github.com/tiran/defusedxml/issues/54 -import defusedxml.ElementTree as DefusedET # isort:skip - from radicale import (auth, hook, config, httputils, pathutils, rights, storage, types, web, xmlutils) from radicale.log import logger +# HACK: https://github.com/tiran/defusedxml/issues/54 +import defusedxml.ElementTree as DefusedET # isort:skip sys.modules["xml.etree"].ElementTree = ET # type:ignore[attr-defined] diff --git a/radicale/app/delete.py b/radicale/app/delete.py index 4980a8ad..8335ee11 100644 --- a/radicale/app/delete.py +++ b/radicale/app/delete.py @@ -94,4 +94,4 @@ class ApplicationPartDelete(ApplicationBase): for i in hook_notification_item_list: self._hook.notify(i) headers = {"Content-Type": "text/xml; charset=%s" % self._encoding} - return client.OK, headers, self._write_xml_content(xml_answer) + return client.OK, headers, self._xml_response(xml_answer) diff --git a/radicale/app/put.py b/radicale/app/put.py index 3c394ce5..cf2a15fb 100644 --- a/radicale/app/put.py +++ b/radicale/app/put.py @@ -22,6 +22,7 @@ import posixpath import socket import sys from http import client +from types import TracebackType from typing import Iterator, List, Mapping, MutableMapping, Optional, Tuple import vobject @@ -31,7 +32,6 @@ from radicale import httputils, pathutils, rights, storage, types, xmlutils from radicale.app.base import Access, ApplicationBase from radicale.hook import HookNotificationItem, HookNotificationItemTypes from radicale.log import logger -from types import TracebackType MIMETYPE_TAGS: Mapping[str, str] = {value: key for key, value in xmlutils.MIMETYPES.items()} diff --git a/radicale/item/__init__.py b/radicale/item/__init__.py index 995508fc..4a3fc22e 100644 --- a/radicale/item/__init__.py +++ b/radicale/item/__init__.py @@ -36,8 +36,8 @@ from typing import (Any, Callable, List, MutableMapping, Optional, Sequence, import vobject -from radicale import pathutils from radicale import storage # noqa:F401 +from radicale import pathutils from radicale.item import filter as radicale_filter from radicale.log import logger