kaegi / MorphMan

Anki plugin that reorders language cards based on the words you know
Other
262 stars 66 forks source link

Bug found in 2.1.26 #207

Open joestrong opened 4 years ago

joestrong commented 4 years ago

When reviewing cards I got a crash in 2.1.26 (previous stable). The popup saying morphman was skipping cards came up at the same time.

My distro has only just released 2.1.35, which I have now upgraded to, and I haven't seen the problem, so it might be fine in the latest version, but I wanted to report this anyway for completeness.

Perhaps the easist solution is to only support upwards of 2.1.35 going forwards? (considering the Anki API changes quite a lot)

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, repeat 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 on the add-ons section of our support site. 
Debug info:
Anki 2.1.26 (arch-linux-2.1.26-1) Python 3.8.6 Qt 5.15.1 PyQt 5.15.1
Platform: Linux
Flags: frz=False ao=True sv=1
Add-ons, last update check: 2020-11-28 15:37:06
Add-ons possibly involved: ⁨MorphMan⁩

Caught exception:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/aqt/webview.py", line 464, in handler
    cb(val)
  File "/usr/lib/python3.8/site-packages/aqt/reviewer.py", line 327, in _onAnswerButton
    self._answerCard(int(val))
  File "<decorator-gen-10>", line 2, in _answerCard
  File "/usr/lib/python3.8/site-packages/anki/hooks.py", line 638, in decorator_wrapper
    return repl(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/anki/hooks.py", line 633, in repl
    return old(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/aqt/reviewer.py", line 268, in _answerCard
    self.nextCard()
  File "/usr/lib/python3.8/site-packages/aqt/reviewer.py", line 110, in nextCard
    c = self.mw.col.sched.getCard()
  File "/usr/lib/python3.8/site-packages/anki/schedv2.py", line 55, in getCard
    card = self._getCard()
  File "/usr/lib/python3.8/site-packages/anki/sched.py", line 238, in _getCard
    c = self._getNewCard()
  File "<decorator-gen-6>", line 2, in _getNewCard
  File "/usr/lib/python3.8/site-packages/anki/hooks.py", line 638, in decorator_wrapper
    return repl(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/anki/hooks.py", line 635, in repl
    return new(_old=old, *args, **kwargs)
  File "/home/joe/.local/share/Anki2/addons21/MorphMan/morph/newMorphHelper.py", line 99, in my_getNewCard
    card = _old(self)  # type: anki.cards.Card
  File "/usr/lib/python3.8/site-packages/anki/schedv2.py", line 410, in _getNewCard
    if self._fillNew():
  File "<decorator-gen-2>", line 2, in _fillNew
  File "/usr/lib/python3.8/site-packages/anki/hooks.py", line 638, in decorator_wrapper
    return repl(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/anki/hooks.py", line 635, in repl
    return new(_old=old, *args, **kwargs)
  File "/home/joe/.local/share/Anki2/addons21/MorphMan/morph/newMorphHelper.py", line 47, in my_fillNew
    return _old(self, recursing)
TypeError: _fillNew() takes 1 positional argument but 2 were given
ianki commented 3 years ago

Yeah, the card api has changed. I think Anki 2.1.35 will be the new stable for the next 6 months or so.