On 1 May 2011 03:38, Alejandro <afrit...@gmail.com> wrote:
> Hi,
> I have the following in httpd.conf:
>
> LoadModule wsgi_module modules/mod_wsgi.so
>
> WSGIScriptAlias /wsgi "C:/temp/wsgi_test.py"
>
> <Directory "C:/temp">
> AllowOverride None
> Options None
> Order deny,allow
> Allow from all
> </Directory>
>
> Which with a wsgi_test.py like:
>
> def application(environ, start_response):
>
>    status = '200 OK'
>    output = 'Hello World!'
>
>    response_headers = [('Content-type', 'text/plain'), ('Content-
> Length', str(len(output)))]
>    start_response(status, response_headers)
>
>    return [output]
>
> works fine and returns Hello World, so i suppose that the basic things
> work ok.
>
> Now, if i add to the wsgi_test.py, a:
>
> from Crypto.Cipher import AES
>
> or
>
> import pywintypes
>
> i get loading errors, with Crypto for example:
>
> [Sat Apr 30 14:32:27 2011] [info] mod_wsgi (pid=3756): Create
> interpreter 'nb-alejandro.quipugmbh.com|/wsgi'.
> [Sat Apr 30 14:32:27 2011] [info] [client 127.0.0.1] mod_wsgi
> (pid=3756, process='', application='nb-alejandro.quipugmbh.com|/
> wsgi'): Loading WSGI script 'C:/temp/wsgi_test.py'.
> [Sat Apr 30 14:32:27 2011] [error] [client 127.0.0.1] mod_wsgi
> (pid=3756): Target WSGI script 'C:/temp/wsgi_test.py' cannot be loaded
> as Python module.
> [Sat Apr 30 14:32:27 2011] [error] [client 127.0.0.1] mod_wsgi
> (pid=3756): Exception occurred processing WSGI script 'C:/temp/
> wsgi_test.py'.
> [Sat Apr 30 14:32:27 2011] [error] [client 127.0.0.1] Traceback (most
> recent call last):
> [Sat Apr 30 14:32:27 2011] [error] [client 127.0.0.1]   File "C:/temp/
> wsgi_test.py", line 3, in <module>
> [Sat Apr 30 14:32:27 2011] [error] [client 127.0.0.1]     from
> Crypto.Cipher import AES
> [Sat Apr 30 14:32:27 2011] [error] [client 127.0.0.1] ImportError: DLL
> load failed: The specified module could not be found.
>
> if i run running wsgi_test.py from command line it works fine, no
> complaints.
>
> I have googled quite a lot and there seem to be different
> explanations, the closest one to my problem apparently related to
> manifests and being stripped in latest python versions (http://
> bugs.python.org/issue4120) and apache not having any, but i am really
> confused if i am looking in the right direction.
>
> Any idea how to advance with this?

The only solution is for the third party C extension (Crypto) to be
built with a dependency on the required DLL. I am not a Windows person
so don't know how that is done. It seems though some people have found
that using mingw compiler instead of Microsoft compiler will
automatically add the dependency without needing to modify the build
files for the package having the issue.

Another package from memory that has been affected by this has been
SQLAlchemy. In later versions of that they are adding the dependencies
themselves so will work under embedded systems that themselves don't
link the required DLL.

That the original change was made in Python as per that bug may have
solved the problem for one single person, but has screwed up things
for everyone doing embedded systems where they don't have any control
over what the master executable links, in this case Apache. Thus, is a
bit disappointing that they didn't think of the wider impacts of the
change. Unfortunately it is highly unlikely that Python will now ever
be changed back to how it was.

Graham

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

Reply via email to