[mod_python] Session initializatin failes - unsubscriptable object

Lukas Linhart almad at include.cz
Sun Jan 16 19:19:28 EST 2005


i've started playing with mod_python again...and I'm unable to create Sessions 
- initialization create some strange output I don't quite understand; I tried 
to control Cookie.py, but I hasn't found anything helpful (I'm not very 
skilled this way). 

Do You have any suggestions? 

Thanks for help, 


=== info ===
[ebuild   R   ] net-www/apache-2.0.52-r1  +berkdb -debug -doc +gdbm -ipv6 
-ldap +ssl -static +threads 0 kB
[ebuild   R   ] dev-python/mod_python-3.1.3  0 kB
[ebuild   R   ] dev-lang/python-2.3.4  +X +berkdb -bootstrap -build -debug 
-doc +gdbm +ipv6* +ncurses +readline +ssl +tcltk -ucs2 0 kB

=== script ===
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from mod_python import Session

def index(req):
 req.content_type = "text/plain"
 req.write("New session")
 relace = Session.Session(req)
=== end of script ===

=== output ===
New session
Mod_python error: "PythonHandler mod_python.publisher"

Traceback (most recent call last):

  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in 
    result = object(req)

  File "/usr/lib/python2.3/site-packages/mod_python/publisher.py", line 136, 
in handler
    result = util.apply_fs_data(object, req.form, req=req)

  File "/usr/lib/python2.3/site-packages/mod_python/util.py", line 361, in 
    return object(**args)

  File "/var/www/webroot/pythontest/index.py", line 8, in index
    req.write("New session")

  File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line 389, in 
    timeout=timeout, lock=lock)

  File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line 294, in 
    timeout=timeout, lock=lock)

  File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line 132, in 
    Cookie.add_cookie(self._req, self.make_cookie())

  File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line 160, in 
    c.path = dirpath[len(docroot):]

TypeError: unsubscriptable object

=== end of output ===

Lukas "Almad" Linhart

[:: http://www.Include.cz/ ::]
[:: Including Your wishes ::]
[:: PGP/GNUPg key: http://download.almad.net/pubkey.asc ::]

More information about the Mod_python mailing list