[albatross-users] Exception: set_page() passing wrong number of parameters to page_enter()?

Sheila King sheila at thinkspot.net
Tue May 20 06:10:37 EST 2003


--On Sunday, May 18, 2003 11:59 PM -0700 Sheila King <sheila at thinkspot.net> 
wrote:

...<snippage>...

> However, if I move the comment symbol, and comment out the 'pass'
> statement, and try to enable the set_page statement, I get the following
> traceback:
>
> Template traceback (most recent call last):
>
> Traceback (most recent call last):
>   File "/big/dom/xexample/lib/python2.2/site-packages/albatross/app.py",
> line 146, in run
>     self.process_request(ctx)
>   File
> "/big/dom/xexample/lib/python2.2/site-packages/albatross/randompage.py",
> line 61, in process_request
>     return PageModuleMixin.process_request(self, ctx)
>   File "/big/dom/xexample/lib/python2.2/site-packages/albatross/app.py",
> line 298, in process_request
>     func(ctx)
>   File "login.py", line 6, in page_process
>     ctx.set_page('myaccount')
>   File "/big/dom/xexample/lib/python2.2/site-packages/albatross/app.py",
> line 87, in set_page
>     self.app.page_enter(self, args)
> TypeError: page_enter() takes exactly 2 arguments (3 given)
>
> I am completely at a loss as to how I could be passing the wrong number
> of  parameters, as I have reviewed all of the set_page statements in the
> sample  code included with the Albatross package, and they all have the
> same syntax.

Trying to do SOMETHING to close in on this error message, I made the 
following modifications to the app.py file, just before line 87 where the 
error was occurring when the call to page_enter occurs:

    def set_page(self, name, *args):
        if self.locals.__page__ \
           and self.locals.__page__ != name:
            self.app.load_page(self)
            self.app.page_leave(self)
        self.locals.__page__ = name
        self.app.load_page(self)
        ######## debugging code #########
        f = open("alb-debug.txt", "w")
        f.write("*args is %s" % str(args))
        f.close()
        ####### end debugging code #######
        self.app.page_enter(self, args)

Then I look in the alb-debug.txt file after running the application and 
getting the same traceback. Contents of the file are as follows:

*args is ()

exactly, mind you. No leading or trailing whitespace of any type.

Now the call where this occurs is:

self.app.page_enter(self, args)

so the only way I can see three parameters being passed here, is if the 
page_enter function is interpreting '(' as one argument, and ')' as a 
second argument.

This is very bizarre. :\
-- 
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org




More information about the Albatross-users mailing list