From: Ian B. <ia...@co...> - 2004-11-17 16:45:44
|
Eric Radman wrote: > I've been working on porting several apps over to the WSGI framework, > and found minor differences in session handling that require code > correction: > > The current WSGI implementation returns None for uninitialized Session > variables, whereas WebKit would dump without a try...except pair. > > Using Webware/WebKit: > > session = self.session() > try: > id = session['userid'] > except: > id = None > if id is None: > """ Error """ > else > """ Generate Page """ > > Using WSGIKit: > > session = self.session() > id = session._values['userid'] > if id is None: > """ Error """ > else > """ Generate Page """ > > This is fine, but session[] always returns None, so I have to use > _values[]. Is this a bug or intended behavior? It would be a bug. I forgot to put in a return for the __getitem__ method. Doh. Fixed in svn. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |