[mod_python] "unsubscriptable object" error when instantiating a session

Roberto Aguilar roberto.c.aguilar at gmail.com
Wed Jul 13 03:28:00 EDT 2005


Hello,

When attempting to instantiate a session object, I get the following error:

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

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

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

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

TypeError: unsubscriptable object

Turns out dirpath = None on the two systems I've tried this on:

- linux, apache 2.0.54, python 2.2, mod_python 3.1.4
- os x apache 2.0.54, python 2.4.1, mod_python 3.1.4

I'm not sure if I did the correct thing, but, here is a patch to solve
the issue.  Please let me know if what I did is totally off.  But, at
least sessions are working just fine now.  : )

Thanks!

-berto.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Session.py.patch
Type: application/octet-stream
Size: 1481 bytes
Desc: not available
Url : http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20050713/4e634b03/Session.py.obj


More information about the Mod_python mailing list