cayennes / kanji-colorize

a script and anki addon to turn KanjiVG data into colored stroke order diagrams
121 stars 25 forks source link

Error with Anki 2.1.28 #61

Closed AndrewReitz closed 4 years ago

AndrewReitz commented 4 years ago

Recently update Anki from 2.1.16 to 2.1.28 and I'm getting the following issue. The error occurs after I paste in Kanji and hit tab.

Please let me know if there is any way I can help assist in debugging this issue.

Debug info: Anki 2.1.28 (7d8818f8) Python 3.8.0 Qt 5.15.0 PyQt 5.15.0 Platform: Mac 10.15.6 Flags: frz=True ao=True sv=1 Add-ons, last update check: 2020-07-25 10:41:46 Add-ons possibly involved: ⁨Kanji Colorizer stroke order diagrams, Frozen Fields⁩

Caught exception: Traceback (most recent call last): File "aqt/webview.py", line 35, in cmd File "aqt/webview.py", line 121, in _onCmd File "aqt/webview.py", line 536, in _onBridgeCmd File "</Applications/Anki.app/Contents/MacOS/decorator.pyc:decorator-gen-2>", line 2, in onBridgeCmd File "anki/hooks.py", line 638, in decorator_wrapper File "anki/hooks.py", line 635, in repl File "/Users/andrewreitz/Library/Application Support/Anki2/addons21/516643804/main.py", line 135, in onBridge return _old(self, str) File "aqt/editor.py", line 397, in onBridgeCmd File "aqt/gui_hooks.py", line 1467, in call File "anki/hooks.py", line 594, in runFilter File "/Users/andrewreitz/Library/Application Support/Anki2/addons21/1964372878/kanji_colorizer.py", line 150, in onFocusLost return addKanji(note, flag, currentFieldIndex) File "/Users/andrewreitz/Library/Application Support/Anki2/addons21/1964372878/kanji_colorizer.py", line 141, in addKanji note.flush() File "anki/notes.py", line 67, in flush AssertionError

AndrewReitz commented 4 years ago

I removed the note.flush() on line 141 and everything seems to be working just fine.

cayennes commented 4 years ago

Thanks for letting me know! I've uploaded a fixed version