From: Paul Eggleton Date: Thu, 19 Jan 2017 20:16:22 +0000 (+1300) Subject: devtool: check locale and refuse to start if it isn't UTF-8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=217c70e9ea20c2872a66b34294e559a113250569;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git devtool: check locale and refuse to start if it isn't UTF-8 We need to ensure the locale is UTF-8 or otherwise strange errors will occur later on during execution - the same reason we check this in BitBake itself. Unfortunately this check has to be before command line parsing and therefore showing the help text in response to --help, since that relies upon parsing bitbake's configuration (as we need to load plugins in other layers). Fixes [YOCTO #10908]. Signed-off-by: Paul Eggleton --- diff --git a/scripts/devtool b/scripts/devtool index 0866be9d5f0..c9ad9ddb955 100755 --- a/scripts/devtool +++ b/scripts/devtool @@ -215,6 +215,9 @@ def main(): global config global context + if sys.getfilesystemencoding() != "utf-8": + sys.exit("Please use a locale setting which supports utf-8.\nPython can't change the filesystem locale after loading so we need a utf-8 when python starts or things won't work.") + context = Context(fixed_setup=False) # Default basepath