From efecae5a11617eb576d475192384339fcdb03189 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sun, 12 Nov 2017 14:23:41 -0800 Subject: [PATCH] Full path to database now works e.g. datasette /tmp/blah.db Previously this failed because it did not open with full path. --- datasette/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datasette/app.py b/datasette/app.py index 85785c07..3a3efbe4 100644 --- a/datasette/app.py +++ b/datasette/app.py @@ -493,7 +493,7 @@ class Datasette: m.update(data) # List tables and their row counts tables = {} - with sqlite3.connect('file:{}?immutable=1'.format(path.name), uri=True) as conn: + with sqlite3.connect('file:{}?immutable=1'.format(path), uri=True) as conn: conn.row_factory = sqlite3.Row table_names = [ r['name'] @@ -504,7 +504,7 @@ class Datasette: metadata[name] = { 'hash': m.hexdigest(), - 'file': path.name, + 'file': str(path), 'tables': tables, } self._metadata = metadata