EnvironmentStub.upgrade fails for in-memory SQLite database
|Reported by:||Ryan J Ollos||Owned by:||Ryan J Ollos|
Description (last modified by )
Discussed in gmessage:trac-dev:Ri1Xj1HBNms/2gME805cCQAJ. I didn't explore the issue in detail, but it appears that an effective workaround is to not close the database for in-memory SQLite:
diff --git a/trac/env.py b/trac/env.py index 8790e49..8f37b12 100644
a b class Environment(Component, ComponentManager): 822 822 with self.db_transaction as db: 823 823 participant.upgrade_environment(db) 824 824 # Database schema may have changed, so close all connections 825 DatabaseManager(self).shutdown() 825 dbm = DatabaseManager(self) 826 if dbm.connection_uri != 'sqlite::memory:': 827 dbm.shutdown() 826 828 del self.database_version 827 829 return True
However, it needs to be explored further before any definite conclusions are drawn.