I am testing a web application that I built using web.py. Many times I have
seen that things fail and I see following error in the logs:
AttributeError: 'ThreadedDict' object has no attribute 'session_id'
In such a case, invariably it is found, that the same URL with the same
parameters has worked many times (implying there is nothing wrong with the
URL and POST request) before and as soon as I restart the web server the
failed URL when resubmitted works! The failure is due to session_id
attribute not being found in the session object.
Does anybody know what's going on?
The error log shows this:
Traceback (most recent call last)
File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 239,
in process return self.handle()
File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 230,
in handle return self._delegate(fn, self.fvars, args)
File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 420,
in _delegate return handle_class(cls)
File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 396,
in handle_class return tocall(*args)
File "/var/www/khojpal/tmain.py", line 748, in GET return '{"uid": "' +
str(session.uid) + '", "webpy_session_id":"' + session.session_id + '"}'
File "/usr/local/lib/python2.7/dist-packages/web/session.py", line 71, in
__getattr__ return getattr(self._data, name)
AttributeError: 'ThreadedDict' object has no attribute 'session_id'
The webpy_session_id does exist in the sessions table when it fails. I can
not debug this code under Apache and this failure is never seen on desktop
running under Eclipse.
Thanks
Suhas.
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/d/optout.