Commit 80fe1ad5 authored by Remi Rampin's avatar Remi Rampin

Fix --database=filename

When passing a filename with no directory whatsoever, makedirs() would
be called with '' and fail.
parent f782f724
Pipeline #66381018 passed with stage
in 2 minutes and 4 seconds
...@@ -38,7 +38,8 @@ def prepare_db(database): ...@@ -38,7 +38,8 @@ def prepare_db(database):
else: else:
# Path: create it, turn into URL # Path: create it, turn into URL
database = os.path.expanduser(database) database = os.path.expanduser(database)
os.makedirs(os.path.dirname(database), exist_ok=True) if os.path.dirname(database):
os.makedirs(os.path.dirname(database), exist_ok=True)
db_url = 'sqlite:///' + database db_url = 'sqlite:///' + database"Turning database path into URL: %s", db_url)"Turning database path into URL: %s", db_url)
return db_url return db_url
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment