Closed Gustaf-C closed 8 months ago
I ran into this issue with simple definition generation too, not just with bulk mode. Since addons are shared across plugins, the source of the error seems to be here:
There doesn't seem to be a hook for exiting and this has the right spirit, its just that the Dictionary
instantiation at the global scope isn't quite there. We can add a profile_did_open
hook to set up the connection to the database, rather than doing so in the constructor.
Thanks for the pointer, was a quick fix
Other fills seem to work fine.
Caught exception: Traceback (most recent call last): File "/Library/Application Support/Anki2/addons21/chinese/fill.py", line 96, in bulk_fill_all n_updated += update_fields(note, 'Hanzi', fields) File "/Library/Application Support/Anki2/addons21/chinese/behavior.py", line 311, in update_fields fill_all_defs(hanzi, copy) File "/Library/Application Support/Anki2/addons21/chinese/behavior.py", line 96, in fill_all_defs fill_def(hanzi, note, lang='en'), File "Library/Application Support/Anki2/addons21/chinese/behavior.py", line 74, in fill_def classifier = get_classifier(hanzi, note) File "Library/Application Support/Anki2/addons21/chinese/behavior.py", line 45, in get_classifier cs = dictionary.get_classifiers(hanzi) File "Library/Application Support/Anki2/addons21/chinese/database.py", line 219, in get_classifiers self.c.execute( sqlite3.ProgrammingError: Cannot operate on a closed database.