From 249cf0b236914ee669438d96e0c3e618dd9fbef1 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Thu, 18 Dec 2014 11:02:15 +1100 Subject: Log error message when can't set the language locale due to it not being supported by operating system. --- tests/environ.wsgi | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/environ.wsgi b/tests/environ.wsgi index 26ce97d..c50c88e 100644 --- a/tests/environ.wsgi +++ b/tests/environ.wsgi @@ -2,6 +2,7 @@ from __future__ import print_function import os import sys +import locale try: from cStringIO import StringIO @@ -67,6 +68,18 @@ def application(environ, start_response): print('PATH: %s' % sys.path, file=output) print(file=output) + print('LANG: %s' % os.environ.get('LANG'), file=output) + print('LC_ALL: %s' % os.environ.get('LC_ALL'), file=output) + print('sys.getdefaultencoding(): %s' % sys.getdefaultencoding(), + file=output) + print('locale.getlocale(): %s' % (locale.getlocale(),), + file=output) + print('locale.getdefaultlocale(): %s' % (locale.getdefaultlocale(),), + file=output) + print('locale.getpreferredencoding(): %s' % locale.getpreferredencoding(), + file=output) + print(file=output) + keys = sorted(environ.keys()) for key in keys: print('%s: %s' % (key, repr(environ[key])), file=output) -- cgit v1.2.1