On Mac, during review, Anki intermittently crashes

When I study my Chinese deck, Anki crashes intermittently (about every 3~50cards), showing this error log:

Anki 23.12.1 (1a1d4d54)  
Python 3.9.15 Qt 6.5.3 PyQt 6.5.3
Platform: macOS-11.7.10-x86_64-i386-64bit

Socket error
Traceback (most recent call last):
  File "waitress.channel", line 132, in _flush_exception
  File "waitress.channel", line 270, in _flush_some
  File "waitress.wasyncore", line 431, in send
OSError: [Errno 41] Protocol wrong type for socket

the crash only occurs when I press “Show Answer” or one of the answer buttons. I’ve already got through troubleshooting steps, but the problem remains.

After some googling, I noticed the situation is really alike with this post: (anki-crash-when-using-a-specific-deck/22266)
So I tried to open the debug console, but none of the suggested shortcuts(Command+Shift+‘;‘or’:‘or’+’) works.

Any help is appreciated.

I can’t help with the crash, but are you using a non-English keyboard layout? Try Cmd <whatever types : in your layout> or switch to an English layout to type the shortcut.

[see “Related Issue” at the end Inconsistent keyboard shortcuts on Turkish-Q layout]


Are you using any add-ons?

Troubleshooting - Anki Manual

Thanks, that really helps! You’re right, I’m using Japanese keyboard layout. Command+‘:’ does the trick!
Now I can check if this snippet can make the error go away.

from errno import EPROTOTYPE
import waitress.wasyncore
waitress.wasyncore._DISCONNECTED = waitress.wasyncore._DISCONNECTED.union({EPROTOTYPE})

I’m using some add-ons (Awesome TTS, Hanzi Stats, and my homemade ones). But even if I start Anki with holding down the shift key, the error persists.

With the above snippet, even after review of 400 cards, not a single error occurred.

1 Like

Thanks for confirming. I’ll make Anki do that automatically in the next release.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.