jdlorimer / incremental-reading

Anki add-on providing incremental reading features
https://ankiweb.net/shared/info/935264945
ISC License
216 stars 38 forks source link

<class 'ValueError'>: list.remove(x): x not in list #63

Open aleksejrs opened 6 years ago

aleksejrs commented 6 years ago

v4.9.7, when rating a non-IR card supposedly after rating or extracting an IR card.

Anki 2.1.0beta36 Python 3.6.2 Qt 5.9.2 PyQt 5.9
Platform: Linux
Flags: frz=True ao=True        

Caught exception:
  File "aqt/reviewer.py", line 447, in _onTypedAnswer
  File "aqt/reviewer.py", line 218, in _showAnswer
  File "anki/hooks.py", line 28, in runHook
  File "/home/fc/.local/share/Anki2/addons21/1152164089/main.py", line 124, in onShowAnswer
    mw.stateShortcuts.remove(qs)
<class 'ValueError'>: list.remove(x): x not in list
aleksejrs commented 6 years ago

Maybe when showing the card, not rating. It happens with two cards after an IR one.

omarkohl commented 6 years ago

Same issue here. It happened after extracting a regular note from an IR note with a shortcut and then reviewing the next card (a normal one). An error message appeared in Anki (Please restart with Shift key...) and the same stack trace as above could be seen in the console.

Anki 2.1.0 Incremental Reading 4.9.11

cjsmooth commented 5 years ago

I am experiencing the same bug on Windows 10. It occurs when clicking 'Show Answer' on a non-IR card after reviewing an IR card, but only on first opening Anki. Once I have dismissed the error I don't seem to get it again.

I am using v4.10.3.

Debug info:
Anki 2.1.13 (3ba55990) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3
Platform: Windows 10
Flags: frz=True ao=True sv=1

Caught exception:
  File "aqt\webview.py", line 322, in handler
  File "aqt\reviewer.py", line 461, in _onTypedAnswer
  File "aqt\reviewer.py", line 223, in _showAnswer
  File "anki\hooks.py", line 29, in runHook
  File "C:\Users\Me\AppData\Roaming\Anki2\addons21\935264945\main.py", line 153, in onShowAnswer
    mw.stateShortcuts.remove(qs)
<class 'ValueError'>: list.remove(x): x not in list
jdlorimer commented 5 years ago

This is a long-term annoyance that I haven't had much luck with.

I'll take another look at it.