Modpython again... I can't figure it out.

stibbs stibbs at nothanks.foo
Sun Dec 1 19:22:26 EST 2002


First thing is make sure you compiled python without threads. second
thing, try subscribing to the mod_python mailing list and let me know if
you have any success, they never added me :|.

i had problems till i compiled python without threads, since i've ditched
modpython because if you compile without threads you can't use tkinter. I
know i can have 2 installs of python but i'm more of a one install kinda
guy :) </rant>

stibbs

On Sun, 01 Dec 2002 16:43:25 -0500, Tetsuo wrote:

> So, um... I took another look at the publisher handler and found that it
> can publish a function in a file. So typing
> http://localhost/python/mptest.py/handler produces the correct output.
> But along with it, I get a bunch of gibberish (which also contains some
> data about my computer). I also have an HTM file in the same directory,
> and the computer can't find it. I am guessing I just need to put HTML in
> a different folder...
> 
> Currently, my config has this:
> 
>     <Directory "D:/Apache/htdocs/python">
>         SetHandler python-program
>         PythonHandler mod_python.publisher
>     </Directory>
> 
> I tried to have it together with
> 
>    AddHandler python-program .py
>    PythonHandler mptest
>    PythonDebug on
> 
> as well, and it produced about the same outcome.
> 
> If anyone is willing to help me over email, please do, but Usenet is
> fine... Just help me. My real address is *tsurusennin at softhome dot
> net*. (Trying to beat spam bots written in Perl.)
> 
> _________________________________________________________________________
> 
> The gibberish:
> 
> HTTP/1.1 200 OK Date: Mon, 02 Dec 2002 00:22:51 GMT Server:
> Apache/1.3.27 (Win32) mod_python/2.7.6 Python/2.2.1 Connection: close
> Transfer- Encoding: chunked Content-Type: text/html; charset=iso-8859-1
> 
> 
> OK
> 
> The server encountered an internal error or misconfiguration and was
> unable to complete your request.
> 
> Please contact the server administrator, admin at localhost and inform them
> of the time the error occurred, and anything you might have done that
> may have caused the error.
> 
> More information about this error may be available in the server error
> log.
> 
> _________________________________________________________________________
> _
> 
> Part of the error log:
> 
> [Sun Dec 01 14:33:02 2002] [notice] mod_python: (Re)importing mptest
> from None
> [Sun Dec 01 14:44:20 2002] [notice] mod_python: (Re)importing mptest
> from None
> [Sun Dec 01 14:44:20 2002] [error] PythonHandler mptest: Traceback (most
> recent call last):
> [Sun Dec 01 14:44:20 2002] [error] PythonHandler mptest:   File "D:
> \Python22\Lib\mod_python\apache.py", line 181, in Dispatch
>     module = import_module(module_name, _req)
> [Sun Dec 01 14:44:20 2002] [error] PythonHandler mptest:   File "D:
> \Python22\Lib\mod_python\apache.py", line 335, in import_module
>     module = imp.load_module(mname, f, p, d)
> [Sun Dec 01 14:44:20 2002] [error] PythonHandler mptest:   File
> "d:/apache/htdocs/python\mptest.py", line 5 [Sun Dec 01 14:44:20 2002]
> [error] PythonHandler mptest:     req.write ("<html>" chr(10) chr(13))
> [Sun Dec 01 14:44:20 2002] [error] PythonHandler mptest: ^ [Sun Dec 01
> 14:44:20 2002] [error] PythonHandler mptest: SyntaxError: invalid syntax
> [Sun Dec 01 14:45:54 2002] [notice] mod_python: (Re)importing mptest
> from None
> [Sun Dec 01 14:45:54 2002] [error] PythonHandler mptest: Traceback (most
> recent call last):
> [Sun Dec 01 14:45:54 2002] [error] PythonHandler mptest:   File "D:
> \Python22\Lib\mod_python\apache.py", line 181, in Dispatch
>     module = import_module(module_name, _req)
> [Sun Dec 01 14:45:54 2002] [error] PythonHandler mptest:   File "D:
> \Python22\Lib\mod_python\apache.py", line 335, in import_module
>     module = imp.load_module(mname, f, p, d)
> [Sun Dec 01 14:45:54 2002] [error] PythonHandler mptest:   File
> "d:/apache/htdocs/python\mptest.py", line 5 [Sun Dec 01 14:45:54 2002]
> [error] PythonHandler mptest:     req.write ("<html>" chr(10) chr(13))
> [Sun Dec 01 14:45:54 2002] [error] PythonHandler mptest: ^ [Sun Dec 01
> 14:45:54 2002] [error] PythonHandler mptest: SyntaxError: invalid syntax
> [Sun Dec 01 14:45:56 2002] [notice] mod_python: (Re)importing mptest
> from None
> [Sun Dec 01 14:45:56 2002] [error] PythonHandler mptest: Traceback (most
> recent call last):
> [Sun Dec 01 14:45:56 2002] [error] PythonHandler mptest:   File "D:
> \Python22\Lib\mod_python\apache.py", line 181, in Dispatch
>     module = import_module(module_name, _req)



More information about the Python-list mailing list