From 31eecac59072831c61c4001e5a64db678e3d15e8 Mon Sep 17 00:00:00 2001 From: Paul Culley Date: Sat, 9 Jun 2018 22:55:07 -0500 Subject: [PATCH] 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. --- gramps/gen/db/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gramps/gen/db/generic.py b/gramps/gen/db/generic.py index 71593b622..b4fce23fc 100644 --- a/gramps/gen/db/generic.py +++ b/gramps/gen/db/generic.py @@ -671,7 +671,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback): if update is False, don't change access times, etc. """ if self._directory != ":memory:": - if update: + if update and not self.readonly: # This is just a dummy file to indicate last modified time of # the database for gramps.cli.clidbman: filename = os.path.join(self._directory, "meta_data.db")