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

Jim Gallacher jg.lists at sympatico.ca
Wed Jul 13 12:09:50 EDT 2005


This has already been fixed in the development version.

Jim

Roberto Aguilar wrote:
> 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.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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