On 15 March 2011 06:45, Andreas Sommer <[email protected]> wrote:
> Hi,
>
> I'm getting the exception
>
>   File
> "/var/www/django-sites/351b488d-80bb-42f0-b1bb-927aa89a1d5c/wsgi_autogen.py",
> line 9, in <module>
>     if os.path.exists(virtualenvDirectory + 'bin')
>   File "/usr/lib/python2.6/genericpath.py", line 18, in exists
>     st = os.stat(path)
> LookupError: no codec search functions registered: can't find encoding
>
> in my WSGI script (autogenerated by my program Site Deploy):
>
> import os
> import sys
>
> sys.path.insert(0,
> u'/var/www/django-sites/351b488d-80bb-42f0-b1bb-927aa89a1d5c')
>
> virtualenvDirectory =
> u'/var/www/django-sites/351b488d-80bb-42f0-b1bb-927aa89a1d5c/django_simple_todo_list/env/'

And if you don't use unicode strings in sys.path?

I have never heard of anyone doing that and didn't know you even could
do it with Python 2.X.

Graham

> activateScriptFilename = ((virtualenvDirectory + 'bin/activate_this.py')
>                           if os.path.exists(virtualenvDirectory + 'bin')
>                           else (virtualenvDirectory +
> 'Scripts/activate_this.py'))
> execfile(activateScriptFilename, dict(__file__ = activateScriptFilename))
>
> os.environ['DJANGO_SETTINGS_MODULE'] =
> 'django_simple_todo_list.settings_site_deploy_absolute_url_compatibility'
>
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
> Putting "import codecs" at the top makes the WSGI app work again. Now my
> question: Is it expected behavior of mod_wsgi that it does not register any
> codec search function? If not, consider this as bug report ;-)
>
> Related old thread:
> http://www.mailinglistarchive.com/html/[email protected]/2010-01/msg00178.html
>
> Andreas
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/modwsgi?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to