[mod_python] Session problem

Matthias Julius lists at julius-net.net
Wed Nov 2 12:16:06 EST 2005


Hi,

I just started to use mod_python and I would like to use
mod_mython.Session.

The minimal script

,----
| from mod_python import Session
| 
| def index(req):
|     s = Session.Session(req)
`----

results in

,----
| 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 HandlerDispatch
|     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 apply_fs_data
|     return object(**args)
| 
|   File "/var/www/pythontest/index.py", line 8, in index
|     s = Session.Session(req)
| 
|   File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line
|   389, in Session
|     timeout=timeout, lock=lock)
| 
|   File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line
|   294, in __init__
|     timeout=timeout, lock=lock)
| 
|   File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line
|   132, in __init__
|     Cookie.add_cookie(self._req, self.make_cookie())
| 
|   File "/usr/lib/python2.3/site-packages/mod_python/Session.py", line
|   160, in make_cookie
|     c.path = dirpath[len(docroot):]
| 
| TypeError: unsubscriptable object
`----

This is mod_python 3.1.3 with python 2.3.5 on apache 2.0.54 - all
Debian packages.

What am I missing?

Matthias



More information about the Mod_python mailing list