Hi all,
  I need your help on this problem. In my default() method, I have
following snippet to detect malformed url. So what I want is to throw
away anything that is not
http://localhost:8080/
or
http://localhost:8080

So I wrote:

if len(args) == 0:      # Suppose that no args provided
    try:
         if kw: # malformed, so redirect
              return "Malformed URL"
          # Redirect to index()
          return self.index()
     except:
           return "Wrong URL"

It actually works fine but with this url:
http://localhost:8080/?action. It gives me errors:

Traceback (most recent call last):
  File
"c:\python24\lib\site-packages\CherryPy-2.1.0-py2.4.egg\cherrypy\_cphttptools.py",
line 271, in run
    main()
  File
"c:\python24\lib\site-packages\CherryPy-2.1.0-py2.4.egg\cherrypy\_cphttptools.py",
line 502, in main
    body = page_handler(*args, **cherrypy.request.paramMap)
  File
"c:\python24\lib\site-packages\TurboGears-0.8a4-py2.4.egg\turbogears\controllers.py",
line 121, in newfunc
    output = func(self, *args, **kw)
TypeError: index() got an unexpected keyword argument 'action'

Please help how I can catch this error.

Reply via email to