[test] absolute sqlite database names in source initialization, avoid pb when cwd is changed later stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 18 May 2010 16:49:41 +0200
branchstable
changeset 5542 a8ad3df5a8a3
parent 5541 eac04dd201f7
child 5546 1bdaa9e1cd57
[test] absolute sqlite database names in source initialization, avoid pb when cwd is changed later
server/sources/native.py
--- a/server/sources/native.py	Tue May 18 16:49:00 2010 +0200
+++ b/server/sources/native.py	Tue May 18 16:49:41 2010 +0200
@@ -33,6 +33,7 @@
 from datetime import datetime
 from base64 import b64decode, b64encode
 from contextlib import contextmanager
+from os.path import abspath
 
 from logilab.common.compat import any
 from logilab.common.cache import Cache
@@ -264,6 +265,7 @@
         if self.dbdriver == 'sqlite' and \
                not getattr(repo.config, 'no_sqlite_wrap', False):
             from cubicweb.server.sources.extlite import ConnectionWrapper
+            self.dbhelper.dbname = abspath(self.dbhelper.dbname)
             self.get_connection = lambda: ConnectionWrapper(self)
             self.check_connection = lambda cnx: cnx
             def pool_reset(cnx):