add_card.py from the example_scripts directory crashes on Windows

12 views
Skip to first unread message

charl...@gmail.com

unread,
Aug 10, 2020, 6:20:02 AM8/10/20
to mnemosyne-proj-users
When I try running add_card.py in the example scripts directory, I get this error:

/c/local/mnemosyne/mnemosyne/example_scripts % /c/Tools/Python38/python add_card.py 
Log body:
 An unexpected error has occurred.
Please forward the following info to the developers:

Traceback (innermost last):
  File "add_card.py", line 10, in <module>
    mnemosyne = Mnemosyne(data_dir)
  File "C:\Users\ckhan\home\local\mnemosyne\mnemosyne\script\__init__.py", line 49, in __init__
    self.initialise(data_dir)
  File "C:\Users\ckhan\home\local\mnemosyne\mnemosyne\libmnemosyne\__init__.py", line 451, in initialise
    self.start_review()
  File "C:\Users\ckhan\home\local\mnemosyne\mnemosyne\libmnemosyne\__init__.py", line 573, in start_review
    self.controller().set_study_mode(self.study_mode_with_id(\
  File "C:\Users\ckhan\home\local\mnemosyne\mnemosyne\libmnemosyne\controllers\default_controller.py", line 114, in set_study_mode
    study_mode.activate()
  File "C:\Users\ckhan\home\local\mnemosyne\mnemosyne\libmnemosyne\study_modes\cram_all.py", line 22, in activate
    self.review_controller().reset(new_only=False)
  File "C:\Users\ckhan\home\local\mnemosyne\mnemosyne\libmnemosyne\review_controllers\SM2_controller.py", line 53, in reset
    self.show_new_question()
  File "C:\Users\ckhan\home\local\mnemosyne\mnemosyne\libmnemosyne\review_controllers\SM2_controller.py", line 96, in show_new_question
    self.review_widget().stop_media()
 TypeError: stop_media() missing 1 required positional argument: 'self'


Cloned mnemosyne from github master.
I'm on Windows, Python 3.8
Not using a virtual environment, just ensured dependent packages are on my PYTHONPATH.

As far as I can tell, it's because review_widget() is returning a class instead of an instance, in turn because ReviewWidget is not marked IMMEDIATELY=1 and has a comment at the top indicating that this is by design to improve performance.

It works just fine on macOS, though.
Any suggestions on what might be causing the issue on Windows?
-ck




 

Peter Bienstman

unread,
Aug 10, 2020, 6:27:29 AM8/10/20
to mnemosyne-...@googlegroups.com
The script runs without problems on my Windows machine. Are you sure
you are running the latest version?

Cheers,

Peter
> --
> You received this message because you are subscribed to the Google Groups "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mnemosyne-proj-u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/mnemosyne-proj-users/ab417b79-b87a-4fa9-b9f2-e356527a20c7o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages