diff roundup/backends/back_sqlite.py @ 2764:d3b3f1b3d59e

sqlite database creation requires existing directory. create the database directory in sql_open_connection() if the directory does not exist.
author Alexander Smishlajev <a1s@users.sourceforge.net>
date Sat, 16 Oct 2004 12:52:53 +0000
parents 402d6d556558
children fddbbeb581bc
line wrap: on
line diff
--- a/roundup/backends/back_sqlite.py	Sat Oct 16 12:43:11 2004 +0000
+++ b/roundup/backends/back_sqlite.py	Sat Oct 16 12:52:53 2004 +0000
@@ -1,4 +1,4 @@
-# $Id: back_sqlite.py,v 1.34 2004-10-08 05:37:44 richard Exp $
+# $Id: back_sqlite.py,v 1.35 2004-10-16 12:52:53 a1s Exp $
 '''Implements a backend for SQLite.
 
 See https://pysqlite.sourceforge.net/ for pysqlite info
@@ -60,6 +60,11 @@
 
         pysqlite will automatically BEGIN TRANSACTION for us.
         '''
+        # make sure the database directory exists
+        # database itself will be created by sqlite if needed
+        if not os.path.isdir(self.config.DATABASE):
+            os.makedirs(self.config.DATABASE)
+
         db = os.path.join(self.config.DATABASE, 'db')
         self.config.logging.getLogger('hyperdb').info('open database %r'%db)
         conn = sqlite.connect(db=db)

Roundup Issue Tracker: http://roundup-tracker.org/