[mod_python] Session problem

Graham Dumpleton grahamd at dscpl.com.au
Wed Nov 2 14:54:22 EST 2005


Known issue, see:

   http://issues.apache.org/jira/browse/MODPYTHON-50

Either ensure that your use of AddHandler for .py extension
is inside a Directory directive or explicitly set ApplicationPath
option.

You could also start using 3.2 beta, as is fixed there.

Graham

On 03/11/2005, at 4:16 AM, Matthias Julius wrote:

> 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
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python



More information about the Mod_python mailing list