summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/sqlite/pysqlite.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-02-10 15:03:11 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2011-02-10 15:03:11 -0500
commite43f85965e516218fd2630dba5d46cbdc8e00e09 (patch)
treea32d157bd8796cf888d15dda1cceb463e8ae434a /lib/sqlalchemy/dialects/sqlite/pysqlite.py
parent3f9a343d725eea883aba2145de4cbb7b84f9d08c (diff)
downloadsqlalchemy-e43f85965e516218fd2630dba5d46cbdc8e00e09.tar.gz
- The path given as the location of a sqlite database is now
normalized via os.path.abspath(), so that directory changes within the process don't affect the ultimate location of a relative file path. [ticket:2036]
Diffstat (limited to 'lib/sqlalchemy/dialects/sqlite/pysqlite.py')
-rw-r--r--lib/sqlalchemy/dialects/sqlite/pysqlite.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/sqlite/pysqlite.py b/lib/sqlalchemy/dialects/sqlite/pysqlite.py
index 646c5b86f..d426b1bb2 100644
--- a/lib/sqlalchemy/dialects/sqlite/pysqlite.py
+++ b/lib/sqlalchemy/dialects/sqlite/pysqlite.py
@@ -143,6 +143,7 @@ from sqlalchemy import exc, pool
from sqlalchemy import types as sqltypes
from sqlalchemy import util
+import os
class _SQLite_pysqliteTimeStamp(DATETIME):
def bind_processor(self, dialect):
@@ -228,6 +229,8 @@ class SQLiteDialect_pysqlite(SQLiteDialect):
" sqlite:///relative/path/to/file.db\n"
" sqlite:////absolute/path/to/file.db" % (url,))
filename = url.database or ':memory:'
+ if filename != ':memory:':
+ filename = os.path.abspath(filename)
opts = url.query.copy()
util.coerce_kw_type(opts, 'timeout', float)