Fix dbapi dbs for closeing read-only db crash (#623)

Fixes #10613

The sqlite (and other dbapi dbs) tried to save their metadata on a close operation, which doesn't work for read-only dbs.
This commit is contained in:
Paul Culley 2018-06-09 22:55:07 -05:00 committed by Sam Manzi
parent 58c6da3fb5
commit 31eecac590

View File

@ -671,7 +671,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
if update is False, don't change access times, etc. if update is False, don't change access times, etc.
""" """
if self._directory != ":memory:": if self._directory != ":memory:":
if update: if update and not self.readonly:
# This is just a dummy file to indicate last modified time of # This is just a dummy file to indicate last modified time of
# the database for gramps.cli.clidbman: # the database for gramps.cli.clidbman:
filename = os.path.join(self._directory, "meta_data.db") filename = os.path.join(self._directory, "meta_data.db")