From b36b670043ad0ad96ae2e8c497ab821c4cd4887e Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 24 Aug 2010 13:09:59 +0900 Subject: [PATCH] older pysqlite can't auto-convert unicode to utf-8 --- ankiqt/ui/sync.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ankiqt/ui/sync.py b/ankiqt/ui/sync.py index f3f275c3b..18136037b 100755 --- a/ankiqt/ui/sync.py +++ b/ankiqt/ui/sync.py @@ -110,7 +110,8 @@ class Sync(QThread): try: if deck: # multi-mode setup - c = sqlite.connect(deck) + sqlpath = deck.encode("utf-8") + c = sqlite.connect(sqlpath) (syncName, localMod, localSync) = c.execute( "select syncName, modified, lastSync from decks").fetchone() c.close() @@ -120,7 +121,8 @@ class Sync(QThread): else: syncName = self.parent.syncName path = self.parent.deckPath - c = sqlite.connect(path) + sqlpath = path.encode("utf-8") + c = sqlite.connect(sqlpath) (localMod, localSync) = c.execute( "select modified, lastSync from decks").fetchone() c.close()