glutanimate / syntax-highlighting

A fork of Tiago Barroso's Syntax Highlighting add-on with support for Anki 2.1
https://ankiweb.net/shared/info/1463041493
Other
108 stars 27 forks source link

anki.errors.NotFoundError/KeyError #39

Open klieret opened 2 years ago

klieret commented 2 years ago

Problem description

Got the following exception (it disappeared after restarting and everything works, this is just FYI):

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue to the add-on author.
Debug info:
Anki 2.1.54 (b6a7760c) Python 3.9.7 Qt 6.3.1 PyQt 6.3.1
Platform: Mac 12.4
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2022-08-21 11:07:01
Add-ons possibly involved: ⁨Syntax Highlighting for Code⁩

Caught exception:
Traceback (most recent call last):
  File "anki.config", line 43, in get_immutable
  File "anki._backend.generated", line 1004, in get_config_json
  File "anki._backend", line 146, in _run_command
anki.errors.NotFoundError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "aqt.main", line 1135, in onAddCard
  File "aqt", line 129, in open
  File "aqt.addcards", line 49, in __init__
  File "aqt.addcards", line 74, in setupEditor
  File "decorator", line 232, in fun
  File "anki.hooks", line 89, in decorator_wrapper
  File "anki.hooks", line 80, in repl
  File "aqt.editor", line 128, in __init__
  File "aqt.editor", line 179, in setupWeb
  File "anki.hooks", line 45, in runFilter
  File "/Users/fuchur/Library/Application Support/Anki2/addons21/1463041493/main.py", line 319, in onSetupButtons21
    previous_lang = get_default_lang(mw)
  File "/Users/fuchur/Library/Application Support/Anki2/addons21/1463041493/main.py", line 84, in get_default_lang
    addon_conf = mw.col.conf['syntax_highlighting_conf']
  File "anki.config", line 62, in __getitem__
  File "anki.config", line 45, in get_immutable
KeyError

Checklist

Please replace the space inside the brackets with an x if the following items apply:

Information about your Anki set-up

Please fill out the section corresponding with your Anki version:

If you are using Anki 2.1

Please open Anki, go to Help → About, click on "Copy Debug Info", and paste the result between the backticks below (if the button does not appear you are using an older version of Anki 2.1 and will need to update first):


    Anki 2.1.54 (b6a7760c) Python 3.9.7 Qt 6.3.1 PyQt 6.3.1
    Platform: Mac 12.4
    Flags: frz=True ao=True sv=2
    Add-ons, last update check: 2022-08-21 11:07:01

    ===Add-ons (active)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    Syntax Highlighting for Code ['1463041493', 2018-10-06T21:31, 'None', '']

    ===IDs of active AnkiWeb add-ons===
    1463041493

    ===Add-ons (inactive)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])

Please fill in details about your operating system (Windows/macOS/Linux, which version):

Please open Anki, go to Tools → Add-ons, take a screenshot of your installed add-ons, and paste it below:

Error message (if any)

See above