Anki Forums

IndexError on D&D'ing media in card browser

Had this happen repeatedly when d&d’ing mp3s in the card browser. Dunno what exactly causes it, seems system audio related where Anki fails to play via mpv, waits, and in the meantime the clipboard gets invalidated.

First attempts had it only shown after an increasingly marked delay but then dropping could be successfully retried, while now (same program instance) the attempt yields a brief freeze and fails consistently.

Otherwise no ill effect, I guess the list access could just use a prefaced check that suppresses the exception.

Caught exception:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/aqt/editor.py", line 1053, in dropEvent
    html, internal = self._processMime(mime)
  File "/usr/lib/python3.8/site-packages/aqt/editor.py", line 1074, in _processMime
    if mime.hasUrls() and mime.urls()[0].toString().startswith("file://"):
IndexError: list index out of range

edit: Uhh, seems to actually have been caused by a Wayland bug as all pasting failed and the desktop eventually crashed altogether.