[albatross-users] problems with a RandomModularSessionApp
Tommy !!
the_edge2020 at hotmail.com
Mon Apr 14 02:54:07 EST 2003
Hi again Greg,
Excuse the delay in posting this, life's tough when you're a student :P
I'll continue on with the bugs I've discovered and fixed ...
As a refresher, for anyone who missed my last post, there is a nasty bug in
apacheapp.py. Simple little typo, really. But it's nasty enough to stop your
program cold when using mod_python with albatross, as poor old Greg found
out.
The fix is as follows:
replace line 34 with the following:
return self.__req.server.server_hostname
And the new stuff, which you will almost certainly encounter with
SessionFileApp-style applications:
In sessionfile.py, you may encounter problems when your session is first
created due to a KeyError being raised in
SessionFileContextMixin._get_sesid_from_cookie. The reason being that it
tries to grab the session ID from the cookie (as the method name implies) -
the thing is, the cookie hasn't been set when it's called.
Thus, the line 'return os.path.basename( c[self.app.ses_appid()].value )'
throws a KeyError since the SimpleCookie c does not have the cookie set just
yet since the session has just started. Ouch.
There's a few ways to fix this. All work to the same effect, however, so
I'll present the simplest:
# BEGIN FIXED CODE, LINE 36, sessionfile.py
try:
return os.path.basename( c[self.app.ses_appid()].value )
except OSError:
pass
#
# FIX: catch a KeyError exception that may be thrown in the try
# clause.
#
except KeyError:
pass
return None
# END FIXED CODE
And there you have it. Little problems like this are here and there in
Albatross.
Strangely, I still haven't heard back from the object-craft team regarding
the initial bug you mentioned. Oh well.
Take it easy, I'll post more bugs as I/if I find them.
Kind regards,
Tom L
>From: Chiron Consulting <chironsw at swbell.net>
>To: Tommy !! <the_edge2020 at hotmail.com>
>Subject: Re: [albatross-users] problems with a RandomModularSessionApp
>Date: Thu, 10 Apr 2003 13:33:03 +0000
>MIME-Version: 1.0
>Received: from mta5.snfc21.pbi.net ([206.13.28.241]) by
>mc5-f32.law1.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Thu, 10 Apr
>2003 13:42:16 -0700
>Received: from swbell.net ([208.191.179.211]) by mta5.snfc21.pbi.net
>(iPlanet Messaging Server 5.1 HotFix 1.6 (built Oct 18 2002)) with ESMTP id
><0HD500INI4YB4J at mta5.snfc21.pbi.net> for the_edge2020 at hotmail.com; Thu, 10
>Apr 2003 11:34:59 -0700 (PDT)
>X-Message-Info: JGTYoYF78jEHjJx36Oi8+Q1OJDRSDidP
>Message-id: <3E95728F.40108 at swbell.net>
>X-Accept-Language: en-us, en
>User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0)
>Gecko/20020529
>References: <F58Kr4qjpQEJhKiiB3D00012767 at hotmail.com>
>Return-Path: chironsw at swbell.net
>X-OriginalArrivalTime: 10 Apr 2003 20:42:16.0648 (UTC)
>FILETIME=[AC5E6480:01C2FFA1]
>
>
>>To fix it simply replace the line (in apacheapp.py -> you'll have to get
>>your hands dirty with the albatross source code):
>>
>>self.__req.connection.server.server_hostname
>>
>>with:
>>
>>self.__req.server.server_hostname
>
>Great. That did it.
>
>>You will find a few other small bugs are also present. More on that
>>later...
> > All the bugs I've come across so far can be resolved with small
> > edits of the albatross source code.
>
>Please post them at your earliest convenience, the sooner the better. Any
>fixes you can post are things I won't have to find and fix for myself.
>Unless you can get the object-craft people to integrate them and release a
>new minor version.
>
>>Long live OSS, eh?
>
>Eh, indeed! Thanks loads.
>
>--
>Greg Goodman
>Chiron Consulting
>
_________________________________________________________________
MSN Instant Messenger now available on Australian mobile phones. Go to
http://ninemsn.com.au/mobilecentral/hotmail_messenger.asp
More information about the Albatross-users
mailing list