I have updated mod_wsgi to issue an error message now. https://github.com/GrahamDumpleton/mod_wsgi/archive/develop.tar.gz
You could try that and verify you get an error message with de_DE.UTF-8, thereby confirming that was the issue. I have noticed that especially under Docker with a trimmed down OS you are missing language packs which would allow even common en_US.UTF-8 to work. Graham On 17/12/2014, at 11:26 PM, Graham Dumpleton <[email protected]> wrote: > Can you try using: > > lang=C.UTF-8 locale=C.UTF-8 > > I suspect the problem is that: > > de_DE.UTF-8 > > is not valid in these contexts for your specific operating system build and > as a result when mod_wsgi attempts to update the locale it fails. > > Right now mod_wsgi doesn't check the result and generate an error message in > the logs so you wouldn't know. I will now add one though. > > One way of perhaps working out if it is valid is to do is: > > >>> import locale > >>> locale.setlocale(locale.LC_ALL) > 'C' > >>> locale.setlocale(locale.LC_ALL, 'de_DE.UTF-8') > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/app/.docker/python/lib/python2.7/locale.py", line 579, in setlocale > return _setlocale(category, locale) > locale.Error: unsupported locale setting > >>> locale.setlocale(locale.LC_ALL) > 'C' > >>> locale.setlocale(locale.LC_ALL, 'C.UTF-8') > 'C.UTF-8' > >>> locale.setlocale(locale.LC_ALL) > 'C.UTF-8' > > Graham > > On 17/12/2014, at 9:31 PM, Graham Dumpleton <[email protected]> > wrote: > >> I have managed to replicate the problem under Linux on Docker, so obviously >> Linux is behaving differently to MacOS X. >> >> Graham >> >> On 17/12/2014, at 9:50 AM, Graham Dumpleton <[email protected]> >> wrote: >> >>> Even knowing the full set of locale related environment variables, still >>> can't replicate on MacOS X. Definitely time to try Linux under Docker. >>> >>> Graham >>> >>> On 17/12/2014, at 12:52 AM, Nikolai Prokoschenko <[email protected]> >>> wrote: >>> >>>> Hello Graham, >>>> >>>> On Saturday, December 13, 2014 12:03:14 AM UTC+1, Graham Dumpleton wrote: >>>> Just though so I have everything that might affect OS and what it does, >>>> can you provide me a dump of of os.environ from just before the line that >>>> fails. >>>> >>>> Based on previous minimal application: >>>> >>>> [Tue Dec 16 14:48:37 2014] [error] ('process_group', 'myapp') >>>> [Tue Dec 16 14:48:37 2014] [error] ('application_group', '') >>>> [Tue Dec 16 14:48:37 2014] [error] ('LANG', 'de_DE.UTF-8') >>>> [Tue Dec 16 14:48:37 2014] [error] ('LC_ALL', 'POSIX') >>>> [Tue Dec 16 14:48:37 2014] [error] ('sys.getdefaultencoding()', 'ascii') >>>> [Tue Dec 16 14:48:37 2014] [error] ('locale.getlocale()', ('de_DE', >>>> 'UTF8')) >>>> [Tue Dec 16 14:48:37 2014] [error] ('locale.getdefaultlocale()', (None, >>>> None)) >>>> [Tue Dec 16 14:48:37 2014] [error] ('locale.getpreferredencoding()', >>>> 'ANSI_X3.4-1968') >>>> [Tue Dec 16 14:48:37 2014] [error] {'LC_NUMERIC': '', 'LINES': '64', >>>> 'LC_CTYPE': '', 'OPENSSL_NO_DEFAULT_ZLIB': '1', 'LOGNAME': 'myuser', >>>> 'USER': 'myuser', 'get_module_list_done': 'true', 'LC_PAPER': '', 'PATH': >>>> '/usr/bin:/bin:/usr/sbin:/sbin', 'LANG': 'de_DE.UTF-8', 'TERM': >>>> 'xterm256', 'SHELL': '/bin/bash', 'LC_MONETARY': '', 'PREVLEVEL': 'N', >>>> '_': '/sbin/startproc', 'SUDO_USER': 'myuser', 'HOME': '/home/myuser', >>>> 'USERNAME': 'myuser', 'SUDO_COMMAND': '/etc/init.d/apache2 restart', >>>> 'LC_ADDRESS': '', 'SHLVL': '2', 'SUDO_UID': '1111', 'DAEMON': >>>> '/usr/sbin/httpd2-worker', 'LC_ALL': 'POSIX', 'LC_TIME': '', 'COLUMNS': >>>> '180', 'LC_IDENTIFICATION': '', 'SUDO_GID': '2500', 'LC_MESSAGES': '', >>>> 'LC_COLLATE': '', 'LC_TELEPHONE': '', 'LC_MEASUREMENT': '', 'PWD': >>>> '/srv/myapp/', 'COLORTERM': '1', 'RUNLEVEL': '3', 'LC_NAME': '', 'MAIL': >>>> '/var/mail/root', 'get_includes_done': 'true'} >>>> [Tue Dec 16 14:48:37 2014] [error] mod_wsgi (pid=20835): Exception >>>> occurred processing WSGI script '/srv/myapp/wsgi.py'. >>>> [Tue Dec 16 14:48:37 2014] [error] Traceback (most recent call last): >>>> [Tue Dec 16 14:48:37 2014] [error] File "/srv/myapp/wsgi.py", line 29, in >>>> minimal_application >>>> [Tue Dec 16 14:48:37 2014] [error] os.stat(filename) >>>> [Tue Dec 16 14:48:37 2014] [error] UnicodeEncodeError: 'ascii' codec can't >>>> encode characters in position 5-7: ordinal not in range(128) >>>> >>>> Nikolai. >>>> >>>> -- >>>> You received this message because you are subscribed to the Google Groups >>>> "modwsgi" group. >>>> To unsubscribe from this group and stop receiving emails from it, send an >>>> email to [email protected]. >>>> To post to this group, send email to [email protected]. >>>> Visit this group at http://groups.google.com/group/modwsgi. >>>> For more options, visit https://groups.google.com/d/optout. >>> >> > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/modwsgi. For more options, visit https://groups.google.com/d/optout.
