1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-13 18:50:53 +00:00

Workaround: defusedxml messes up subsequent imports of ElementTree

See https://github.com/tiran/defusedxml/issues/54
This commit is contained in:
Unrud 2020-10-04 10:15:16 +02:00
parent fe796a6b7c
commit d807fc7ff2

View file

@ -32,12 +32,12 @@ import logging
import posixpath import posixpath
import pprint import pprint
import random import random
import sys
import time import time
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
import zlib import zlib
from http import client from http import client
import defusedxml.ElementTree as DefusedET
import pkg_resources import pkg_resources
from radicale import (auth, httputils, log, pathutils, rights, storage, web, from radicale import (auth, httputils, log, pathutils, rights, storage, web,
@ -56,6 +56,10 @@ from radicale.app.put import ApplicationPutMixin
from radicale.app.report import ApplicationReportMixin from radicale.app.report import ApplicationReportMixin
from radicale.log import logger from radicale.log import logger
# WORKAROUND: https://github.com/tiran/defusedxml/issues/54
import defusedxml.ElementTree as DefusedET # isort: skip
sys.modules["xml.etree"].ElementTree = ET
VERSION = pkg_resources.get_distribution("radicale").version VERSION = pkg_resources.get_distribution("radicale").version