On Jan 19, 2011, at 12:32 PM, ron_m wrote: > I was talking about the _unlock call at the top of _try_store_on_disk > > def _try_store_on_disk(self, request, response): > if not hasattr(os,'mkdir'): return > if response._dbtable_and_field \ > or not response.session_id \ > or self._forget: > self._unlock(response) > return > > The session.forget(response) would remove the attribute session_file if a del > session_file occurs in _unlock() but self._forget being true will cause the > _unlock to run again in the branch above and at the top of _unlock the if > response and response.session_file would cause AttributeError. This piece of > code is very intricate. :-)
response is also Storage, so response.session_file is None if there's no session_file attribute. That's already the normal case (I think) if you call session.forget(response) before the session file exists--session_file never gets defined.