memory: be sure that local_dir exists before creating a new database
This commit is contained in:
parent
1066fdb4eb
commit
fceb06836f
1 changed files with 4 additions and 0 deletions
|
|
@ -82,6 +82,10 @@ class SqliteStorage(object):
|
|||
|
||||
info(_("Connecting database"))
|
||||
new_base = not os.path.exists(db_filename) # do we have to create the database ?
|
||||
if new_base: # the dir may not exist if it's not the XDG recommended one
|
||||
dir_ = os.path.dirname(db_filename)
|
||||
if not os.path.exists(dir_):
|
||||
os.makedirs(dir_, 0700)
|
||||
self.dbpool = adbapi.ConnectionPool("sqlite3", db_filename, check_same_thread=False)
|
||||
|
||||
# init_defer is the initialisation deferred, initialisation is ok when all its callbacks have been done
|
||||
|
|
|
|||
Loading…
Reference in a new issue