#852406 mnemosyne: loading configuration file from 2.2.1-3 fails

#852406#5
Date:
2017-01-24 09:14:14 UTC
From:
To:
Dear Maintainer,

after having upgraded mnemosyne from version 2.2.1-3 to 2.4-0.1 the
program refused to start and showed a python exception:

Traceback (innermost last):
  File "/usr/bin/mnemosyne", line 229, in <module>
    debug_file=options.debug_file)
  File
"/usr/lib/python3/dist-packages/mnemosyne/libmnemosyne/__init__.py",
line 190, in initialise
    Upgrade3(self.component_manager).run()
  File
"/usr/lib/python3/dist-packages/mnemosyne/libmnemosyne/upgrades/upgrade3.py",
line 21, in run
    file(os.path.join(self.config().config_dir, "config"), "rb")
 NameError: name 'file' is not defined

I started to debug the file
  /usr/lib/python3/dist-packages/mnemosyne/libmnemosyne/upgrades/upgrade3.py
where the excecption arose, and found a couple of issues:

* the upgrade mechanism used the python2-built-in "file" that was
  removed in python3 (I changed that to the replacement "open"): this was
  the original bug that I had observed.
* the encoding was set to the default "ASCII" but was unable to parse
  non-ASCII strings in my configuration file (I changed that to latin1)
* the configuration updater then wants to load pyqt4, which was not
  installed
* pyqt4 refused to load as pyqt5 was already loaded
(I stopped debugging here)

My workaround: I deleted the configuration diretory ~/.config/mnemosyne.
The database of mnemosyne was not affacted by this as it is stored in
~/.local/share/mnemosyne/. As far as I can tell, I did not lose any data
(except some minor important settings). All cards and also statistics
etc. seem to be intact, and there are no encoding errors.

Thanks!

#852406#10
Date:
2022-07-14 09:34:46 UTC
From:
To:
Hi,

this bug seems pretty much obsolete, since mnemosyne move to Python 3
is now years old, so I'm closing it.

Thanks for the report,

J.Puydt