always use utf-8 paths

This commit is contained in:
j 2015-06-04 12:32:58 +02:00
parent 22a0569f94
commit 01fc5ad40f

View file

@ -225,7 +225,10 @@ class Client(object):
encode = module.encode
def _conn(self):
db_conn = os.path.expanduser(self._config['cache'])
db_conn = self._config['cache']
if isinstance(db_conn, str):
db_conn = db_conn.decode('utf-8')
db_conn = os.path.expanduser(db_conn)
if not os.path.exists(os.path.dirname(db_conn)):
os.makedirs(os.path.dirname(db_conn))
conn = sqlite3.connect(db_conn, timeout=10)