Importer code changes in 2.1.44/45/46

I wrote an (https://ankiweb.net/shared/info/1199027445), many years ago, that allows importing latex files (*.tex). This worked up until at least Anki version 2.1.43. It seems that one of the versions 2.1.44/2.1.45/2.1.46 introduced some essential changes in core anki regarding importers. In the current version, I get the following error message on startup if my addon is loaded:

An add-on you installed failed to load. If problems persist, please go to the Tools>Add-ons menu, and disable or delete the add-on.

When loading '<U+2068>LaTeX Note Importer<U+2069>':
<U+2068>Traceback (most recent call last):
  File "aqt/addons.py", line 230, in loadAddons
  File "/home/marcus/.local/share/Anki2/addons21/1199027445/__init__.py", line 2, in <module>
    from . import lateximport
  File "/home/marcus/.local/share/Anki2/addons21/1199027445/lateximport.py", line 307, in <module>
    importing.Importers = importing.Importers + ((_("Latex Notes (*.tex)"), LatexImporter),)
AttributeError: module 'anki.importing' has no attribute 'Importers'

I have checked the documentation here:

but I cannot find anything about importers. I have not found any similar documentation regarding changes in version 2.1.44 and 2.1.46.

I think this is the commit that caused this:

I guess you can work around the issue for now by monkey-patching the new importers() function.

2 Likes