expand user
This commit is contained in:
parent
71bf50806d
commit
a70040678e
1 changed files with 3 additions and 4 deletions
|
@ -91,10 +91,9 @@ class Client(object):
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
def _conn(self):
|
def _conn(self):
|
||||||
dbfile = self._config['cache']
|
db_conn = os.path.expanduser(self._config['cache'])
|
||||||
if not os.path.exists(os.path.dirname(dbfile)):
|
if not os.path.exists(os.path.dirname(db_conn)):
|
||||||
os.makedirs(os.path.dirname(dbfile))
|
os.makedirs(os.path.dirname(db_conn))
|
||||||
db_conn = os.path.expanduser(dbfile)
|
|
||||||
conn = sqlite3.connect(db_conn, timeout=10)
|
conn = sqlite3.connect(db_conn, timeout=10)
|
||||||
conn.text_factory = sqlite3.OptimizedUnicode
|
conn.text_factory = sqlite3.OptimizedUnicode
|
||||||
return conn, conn.cursor()
|
return conn, conn.cursor()
|
||||||
|
|
Loading…
Reference in a new issue