Re: Testing Python Mod

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris Howell wrote:

Yes I have set it up to listen on port 9000 and everything works fine. I fixed the 404 error. This is the error I am getting now.


MOD_PYTHON ERROR

ProcessId:      2932
Interpreter:    '192.168.0.42'

ServerName:     '192.168.0.42'
DocumentRoot:   'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs'

URI:            '/Test/test.py'
Location:       None
Directory: 'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/Test/' Filename: 'C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\Test\\test.py'
PathInfo:       ''

Phase:          'PythonHandler'
Handler:        'mod_python.publisher'

Traceback (most recent call last):

File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1229, in _process_target
    result = _execute_target(config, req, object, arg)

File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1128, in _execute_target
    result = object(arg)

File "C:\Python25\Lib\site-packages\mod_python\publisher.py", line 204, in handler
    module = page_cache[req]

File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1059, in __getitem__
    return import_module(req.filename)

File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 296, in import_module
    log, import_path)

File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 680, in import_module
    execfile(file, module.__dict__)

File "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\Test\test.py", line 1

    def world(req):

   ^

IndentationError: unexpected indent


MODULE CACHE DETAILS

Accessed:       Tue Sep 04 11:28:20 2007
Generation:     1

_mp_55aa27656fb6b0a34cdceffae0e6fbab {
FileName: 'C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\Test\\test.py'
  Instance:     4 [RELOAD]
  Generation:   1 [ERROR]
  Modified:     Tue Sep 04 11:25:29 2007
  Imported:     Tue Sep 04 11:24:38 2007
}
---------------- End original message. ---------------------

That is solely a python error. Your python script is not properly formatted. In python, white space is significant and code blocks are defined by the indentation. BTW, you read the trace back in reverse order the last thing listed is the cause of the error, the rest is just a trace of the calling stack.

You cannot have any indentation on line 1 of your script as that is the top level of coade and must have zero indentation until you enter a new code block with a different execution scope.

Anyway, this is not an Apache issue any longer, you should read up on python and its syntactical requirements to fix the problem you have now.

Dragon

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Venimus, Saltavimus, Bibimus (et naribus canium capti sumus)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux