From 4a268fcfc086adcf5b02a64a9f98129e5791a74c Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 7 Jan 2009 13:19:54 +0900 Subject: [PATCH] fix unicode issues with cram and open online --- ankiqt/ui/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ankiqt/ui/main.py b/ankiqt/ui/main.py index 5de166ce4..76905439b 100644 --- a/ankiqt/ui/main.py +++ b/ankiqt/ui/main.py @@ -754,7 +754,7 @@ To upgrade an old deck, download Anki 0.9.8.7.""")) self.ensureSyncParams() if not self.saveAndClose(hideWelcome=True): return # we need a disk-backed file for syncing - dir = tempfile.mkdtemp() + dir = unicode(tempfile.mkdtemp(), sys.getfilesystemencoding()) path = os.path.join(dir, u"untitled.anki") self.onNew(path=path) # ensure all changes come to us @@ -1321,13 +1321,13 @@ day = :d""", d=yesterday) s = unicode(s) self.deck.save() # open tmp deck - import tempfile ndir = tempfile.mkdtemp(prefix="anki-cram") path = os.path.join(ndir, "cram.anki") from anki.exporting import AnkiExporter e = AnkiExporter(self.deck) if s: e.limitTags = parseTags(s) + path = unicode(path, sys.getfilesystemencoding()) e.exportInto(path) if not e.exportedCards: ui.utils.showInfo(_("No cards matched the provided tags."))