mar10 / wsgidav

A generic and extendable WebDAV server based on WSGI

Home Page:https://wsgidav.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

defusedxml.lxml deprecation

azmeuk opened this issue · comments

Using wsgidav in pytest with python 3.11 raises this deprecation warning:

wsgidav/xml_tools.py:22
wsgidav/xml_tools.py:22: DeprecationWarning: defusedxml.lxml is no longer supported and will be removed in a future release.
    from defusedxml.lxml import _etree as etree

I use this version:

WsgiDAV/4.3.0 Python/3.11.6(64 bit) Linux-6.6.7-arch1-1-x86_64-with-glibc2.38
Python from: /home/eloi/.cache/pypoetry/virtualenvs/b3desk-XTy7QPnF-py3.11/bin/python

For the record, here is how I initiate my fixture:

@pytest.fixture(scope="session")
def webdav_server(tmp_path_factory):
    root_path = Path(tmp_path_factory.mktemp("webdav"))
    provider = FilesystemProvider(root_path, readonly=False, fs_opts={})

    config = {
        "host": "localhost",
        "port": portpicker.pick_unused_port(),
        "provider_mapping": {"/": provider},
        "http_authenticator": {"domain_controller": None},
        "simple_dc": {"user_mapping": {"*": True}},
        "verbose": 4,
        "logging": {
            "enable": True,
            "enable_loggers": [],
        },
    }
    app = WsgiDAVApp(config)

    server = wsgiref.simple_server.make_server("localhost", config["port"], app)

    server_thread = threading.Thread(target=server.serve_forever)
    server_thread.start()
    try:
        yield app
    finally:
        server.shutdown()
        server_thread.join()