summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGraham Dumpleton <Graham.Dumpleton@gmail.com>2014-12-18 11:02:15 +1100
committerGraham Dumpleton <Graham.Dumpleton@gmail.com>2014-12-18 11:02:15 +1100
commit249cf0b236914ee669438d96e0c3e618dd9fbef1 (patch)
treed2564c99ea20f1e5930dc709c9ddb114a02209ae /tests
parent4de4d6d404a53f98220d995d9a434333f755037b (diff)
downloadmod_wsgi-249cf0b236914ee669438d96e0c3e618dd9fbef1.tar.gz
Log error message when can't set the language locale due to it not being supported by operating system.
Diffstat (limited to 'tests')
-rw-r--r--tests/environ.wsgi13
1 files changed, 13 insertions, 0 deletions
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)