Hi,
On Tuesday, December 9, 2014 3:56:26 AM UTC+1, Graham Dumpleton wrote:
>
> The problem with the example is that the iterable returned should be over
> a sequence of bytes strings, not Unicode strings.
>
I suppose using str(filename) in return statement is enough to be compliant?
> Can you also add in the following prior to the os.stat() and provide what
> the logs say:
>
Of course (slightly anonymized):
[Tue Dec 09 10:22:04 2014] [error] ('process_group', 'my_application')
[Tue Dec 09 10:22:04 2014] [error] ('application_group', '')
[Tue Dec 09 10:22:04 2014] [error] ('LANG', 'de_DE.UTF-8')
[Tue Dec 09 10:22:04 2014] [error] ('LC_ALL', 'POSIX')
[Tue Dec 09 10:22:04 2014] [error] ('sys.getdefaultencoding()', 'ascii')
[Tue Dec 09 10:22:04 2014] [error] ('locale.getlocale()', ('de_DE', 'UTF8'))
[Tue Dec 09 10:22:04 2014] [error] ('locale.getdefaultlocale()', (None,
None))
[Tue Dec 09 10:22:04 2014] [error] ('locale.getpreferredencoding()',
'ANSI_X3.4-1968')
[Tue Dec 09 10:22:04 2014] [error] [client 10.250.205.193] mod_wsgi
(pid=29728): Exception occurred processing WSGI script
'/srv/my_application/app/wsgi.py'.
[Tue Dec 09 10:22:04 2014] [error] [client 10.250.205.193] Traceback (most
recent call last):
[Tue Dec 09 10:22:04 2014] [error] [client 10.250.205.193] File
"/srv/my_application/app/wsgi.py", line 28, in minimal_application
[Tue Dec 09 10:22:04 2014] [error] [client 10.250.205.193]
os.stat(filename)
[Tue Dec 09 10:22:04 2014] [error] [client 10.250.205.193]
UnicodeEncodeError: 'ascii' codec can't encode characters in position 5-7:
ordinal not in range(128)
I notice that LC_ALL is set to POSIX, which is probably where the error
lies, getpreferredencoding() is probably just following that. I'll check
again whether I've got anything wrong with the configuration.
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.