From 62a1382c0de90a4d8faebdba5f5b6716ab1d336b Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 2 Sep 2017 13:59:10 +1000 Subject: [PATCH] python 3 doesn't save us from misconfigured locales --- anki/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/anki/__init__.py b/anki/__init__.py index b7bbb626a..91e4ec504 100644 --- a/anki/__init__.py +++ b/anki/__init__.py @@ -7,6 +7,9 @@ import sys if sys.version_info[0] < 3 or sys.version_info[1] < 6: raise Exception("Anki requires Python 3.6+") +if sys.getfilesystemencoding().lower() in ("ascii", "ansi_x3.4-1968"): + raise Exception("Anki requires a UTF-8 locale.") + version="2.1.0beta15" # build scripts grep this line, so preserve formatting from anki.storage import Collection __all__ = ["Collection"]