On Oct 18, 2:34 pm, "Antony Joseph" <[EMAIL PROTECTED]> wrote:
> @expose()
> def upload(self,*args,**kwargs):
> try:
> form=kwargs['card']
> import csv
> f=form.file
> while 1:
> line=f.readline()
> l=line.split(',')
> if line is not None:
> cardId=l[0]
> if line is None:
> break
> flash(data)
> except IOError, (errno, strerror):
> flash(strerror)
> except:
> flash(sys.exc_info())
> return dict()
This method processes a POST file upload file, right? At url involving
<something>/upload ?
The following error msg is a GET to /admin/cardManager, so AFAICS, has
nothing to do with above code. It looks like your triggering the
'default' method of the Root controller, but with out your full
controller code, it could be anything.
HTH
> My browser get hang and the following msg i got in server.
>
> 127.0.0.1 - - "GET /admin/cardManager HTTP/1.1" 200 3398
> "http://localhost:8080/admin/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:
> 1.8.1.6) Gecko/20070723 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1)"
> 2007-10-18 18:55:17,921 cherrypy.msg INFO HTTP: Page handler: <bound method
> Root.default of <DAM.controllers.Root object at 0xb734e22c>>
> Traceback (most recent call last):
> File "/var/lib/python-support/python2.4/cherrypy/_cphttptools.py", line
> 105, in _run
> self.main()
> File "/var/lib/python-support/python2.4/cherrypy/_cphttptools.py", line
> 254, in main
> body = page_handler(*virtual_path, **self.params)
> File "<string>", line 3, in default
> File "/var/lib/python-support/python2.4/turbogears/controllers.py", line
> 334, in expose
> output = database.run_with_transaction(
> File "<string>", line 5, in run_with_transaction
> File "/var/lib/python-support/python2.4/turbogears/database.py", line 260,
> in so_rwt
> retval = func(*args, **kw)
> File "<string>", line 5, in _expose
> File "/var/lib/python-support/python2.4/turbogears/controllers.py", line
> 351, in <lambda>
> mapping, fragment, args, kw)))
> File "/var/lib/python-support/python2.4/turbogears/controllers.py", line
> 378, in _execute_func
> output = errorhandling.try_call(func, *args, **kw)
> File "/var/lib/python-support/python2.4/turbogears/errorhandling.py", line
> 73, in try_call
> return func(self, *args, **kw)
> TypeError: default() takes exactly 2 arguments (4 given)
> Request Headers:
> REFERER:http://localhost:8080/admin/cardManager
> Content-Length:
> ACCEPT-CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> USER-AGENT: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6)
> Gecko/20070723 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1)
> CONNECTION: keep-alive
> COOKIE: tg-visit=d9396a4854f10fc48274c839aa49f03c1bc9e84b
> HOST: localhost:8080
> ACCEPT: */*
> Remote-Addr: 127.0.0.1
> ACCEPT-LANGUAGE: en-us,en;q=0.5
> Content-Type:
> Remote-Host: 127.0.0.1
> ACCEPT-ENCODING: gzip,deflate
> KEEP-ALIVE: 300
> 127.0.0.1 - - "GET /admin/Mochikit/MochiKit.js HTTP/1.1" 500 2038
> "http://localhost:8080/admin/cardManager" "Mozilla/5.0 (X11; U; Linux i686;
> en-US; rv:1.8.1.6) Gecko/20070723 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1)"
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---