This is how web.py works. GET takes an argument for each parenthesis in the
URL. Read the documentation.

On Dec 31, 2008 6:34 AM, "Michele Petrazzo" <[email protected]>
wrote:


Hi all,
I see a strange problem into a my code with a "catch all" urls
definition, that with a "single page" urls doesn't happen:

urls = ("/", "index",
       )

works well, but

urls = ("/(.*)", "index",
       )

produce:

Traceback (most recent call last):
 File "/home/devel/project/trunk/data/web/application.py", line 211,
in process
   return self.handle()
 File "/home/devel/project/trunk/data/web/application.py", line 201,
in handle
   return self._delegate(fn, self.fvars, args)
 File "/home/devel/project/trunk/data/web/application.py", line 387,
in _delegate
   return handle_class(cls)
 File "/home/devel/project/trunk/data/web/application.py", line 361,
in handle_class
   return tocall(*args)
TypeError: GET() takes exactly 1 argument (2 given)

And if I change the
class index:
   def GET(self):
to
class index:
   def GET(self, *args):

it works.

Following the webpy code, if I debug and "print tocall, args" before
the tocall(*args), I see:

<bound method index.GET of <pages.index instance at 0xb78331cc>> [u'']

What can be?

Another strange thing it's that I cannot reproduce it in a simple test
code... I can do all the tests, if you want, for try to understand.

Thanks,
Michele

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to