Recently, I've started to play around with using sessions to store 
data about users.  This may be related to the kind of data I'm 
trying to store in the session object, but before I post the code 
that does that here is a traceback from when I try to shutdown the 
server with a ctrl-C in a terminal window:

 > ^CShutdown Called
 > ThreadedAppServer: Shutting Down
 > Shutting down the AppServer
 > Application is Shutting Down
 > Exception in thread Thread-2:
 > Traceback (most recent call last):
 >   File "/usr/local/lib/python2.1/threading.py", line 378, in 
__bootstrap
 >     self.run()
 >   File "/usr/local/lib/python2.1/threading.py", line 366, in run
 >     apply(self.__target, self.__args, self.__kwargs)
 >   File "WebKit/AppServer.py", line 86, in closeThread
 >     self.shutDown()
 >   File "/Users/Shared/Webware/WebKit/ThreadedAppServer.py", line 
298, in shutDown
 >     AppServer.shutDown(self)
 >   File "WebKit/AppServer.py", line 119, in shutDown
 >     self._app.shutDown()
 >   File "WebKit/Application.py", line 232, in shutDown
 >     self._sessions.storeAllSessions()
 >   File "WebKit/SessionDynamicStore.py", line 110, in storeAllSessions
 >     self.MovetoFile(i)
 >   File "WebKit/SessionDynamicStore.py", line 98, in MovetoFile
 >     self._fileStore[key] = self._memoryStore[key]
 >   File "WebKit/SessionFileStore.py", line 73, in __setitem__
 >     self.encoder()(item, file)
 > UnpickleableError: Cannot pickle <type 'file'> objects
 >
 >
 > [localhost:Shared/Webware/WebKit] tracysha%

Then, when I start the server back up again, the next page that 
tries to get something from the user's session object, I get this 
traceback:

 > [Mon Mar 18 14:39:05 2002] [error] WebKit: Error while executing 
script /Library/WebServer/Documents/OLNewFontFinder/index
 > Traceback (most recent call last):
 >   File "WebKit/Application.py", line 343, in dispatchRequest
 >     elif self.isSessionIdProblematic(request):
 >   File "WebKit/Application.py", line 426, in isSessionIdProblematic
 >     if (time()-request.session().lastAccessTime()) >= 
request.session().timeout():
 >   File "WebKit/HTTPRequest.py", line 222, in session
 >     return self._transaction.session()
 >   File "WebKit/Transaction.py", line 56, in session
 >     self._session = 
self._application.createSessionForTransaction(self)
 >   File "WebKit/Application.py", line 801, in 
createSessionForTransaction
 >     session = self.session(sessId)
 >   File "WebKit/Application.py", line 637, in session
 >     return self._sessions[sessionId]
 >   File "WebKit/SessionDynamicStore.py", line 61, in __getitem__
 >     self.MovetoMemory(key)
 >   File "WebKit/SessionDynamicStore.py", line 92, in MovetoMemory
 >     self._memoryStore[key] = self._fileStore[key]
 >   File "WebKit/SessionFileStore.py", line 51, in __getitem__
 >     item = self.decoder()(file)
 > EOFError
 >     2  0.42 secs            /webkit/OLNewFontFinder/index

Could this be related to the kind of data that I'm storing in the 
session?  The only thing I am storing currently is an instance of a 
'User' object that I have that is fairly simple with only a few 
attributes and methods, nothing fancy.

My workaround for this now, is to just delete the session files in 
the WebKit/Sessions directory and everything is fine...

Thanks,
Tracy


_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to