jelmer / xandikos

A CalDAV/CardDAV server backed by Git
https://www.xandikos.org/
GNU General Public License v3.0
410 stars 42 forks source link

create_principal breaks with TypeError from the dulwich library #261

Closed tobixen closed 1 year ago

tobixen commented 1 year ago

When running backend.create_principal("/sometestuser/", create_defaults=True) I end up with a traceback.

All xandikos tests are passing, but functional test code for both caldav and plann are breaking as of now. Those tests were definitively working a week ago. I was trying to downgrade both xandikos and dulwich, but so far I haven't been able to get the tests working again, so I'm still not sure what changeset caused things to break.

I can reproduce it like this:

$ python
Python 3.11.5 (main, Aug 28 2023, 20:02:58) [GCC 13.2.1 20230801] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xandikos.web
>>> xandikos.web.run_simple_server('/tmp/xandikos', 'testuser', defaults=True, autocreate=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.11/site-packages/xandikos-0.2.8-py3.11.egg/xandikos/web.py", line 1247, in run_simple_server
    backend.create_principal(
  File "/usr/lib/python3.11/site-packages/xandikos-0.2.8-py3.11.egg/xandikos/web.py", line 982, in create_principal
    create_principal_defaults(self, principal)
  File "/usr/lib/python3.11/site-packages/xandikos-0.2.8-py3.11.egg/xandikos/web.py", line 1142, in create_principal_defaults
    resource.store.set_type(STORE_TYPE_CALENDAR)
  File "/usr/lib/python3.11/site-packages/xandikos-0.2.8-py3.11.egg/xandikos/store/git.py", line 491, in set_type
    self.config.set_type(store_type)
  File "/usr/lib/python3.11/site-packages/xandikos-0.2.8-py3.11.egg/xandikos/store/config.py", line 135, in set_type
    self._save("Set collection type.")
  File "/usr/lib/python3.11/site-packages/xandikos-0.2.8-py3.11.egg/xandikos/store/config.py", line 75, in _save
    self._save_cb(self._configparser, message)
  File "/usr/lib/python3.11/site-packages/xandikos-0.2.8-py3.11.egg/xandikos/store/git.py", line 239, in save_config
    self._import_one(
  File "/usr/lib/python3.11/site-packages/xandikos-0.2.8-py3.11.egg/xandikos/store/git.py", line 698, in _import_one
    index[encoded_name] = IndexEntry(
                          ^^^^^^^^^^^
TypeError: dulwich.index.IndexEntry() argument after * must be an iterable, not IndexEntry
>>>
tobixen commented 1 year ago

(the post above was heavily edited, as I was able to reproduce the problem without involving the functional test code in plann or caldav)

jelmer commented 1 year ago

This is fixed in 0.2.9.

tobixen commented 1 year ago

Sorry the noise ... seems xandikos was imported from the wrong path here.

tobixen commented 12 months ago

Github reports breakages on python 3.8 and 3.9, i.e.:

https://github.com/python-caldav/caldav/actions/runs/6241335645/job/16943331595

Could it be that 0.2.9 is tagged to work only with python 3.10 and higher? While 0.2.8 is tagged to work with python 3.8 and 3.9, but is broken?

Unfortunately I don't have time to dig into this now.

jelmer commented 12 months ago

xandikos declares that it only supports 3.9 or later; it has done so since january 2022, but I guess we hadn't done any releases since then.