From e32f88151c4b4c66dae9da08d73cd9b438261b70 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 25 Feb 2017 17:46:11 +1000 Subject: [PATCH] fix startup error when non-latin text in appdata path --- aqt/profiles.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aqt/profiles.py b/aqt/profiles.py index 236287791..0d256a11b 100644 --- a/aqt/profiles.py +++ b/aqt/profiles.py @@ -243,7 +243,10 @@ and no other programs are accessing your profile folders, then try again.""")) def _defaultBase(self): if isWin: - return os.path.join(os.environ["APPDATA"], "Anki2") + from win32com.shell import shell, shellcon + loc = shell.SHGetFolderPath(0, shellcon.CSIDL_APPDATA, None, 0) + dir = os.path.join(loc, "Anki2") + return dir elif isMac: return os.path.expanduser("~/Library/Application Support/Anki2") else: