Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #740 (closed defect: fixed)

Opened 12 years ago

Last modified 10 years ago

tg_format parameter causing problems with JSON requests

Reported by: godoy Owned by: anonymous
Priority: high Milestone: 0.9a5
Component: TG Widgets Version:
Severity: major Keywords:
Cc:

Description

As reported by me, Michele and other users on the mailing list, and that can be reproduced on the Widget Browser (inside toolbox) at the AutoCompleteField demo -- last demo -- is that it isn't stripping out "tg_format" parameter.

From running the toolbox, I get the following Traceback, that prevents the widget from working:

09/Apr/2006:17:05:09 HTTP INFO Page handler: <bound method AutoCompleteDesc.search of AutoCompleteDesc(name='Auto Complete', for_widget=AutoCompleteField(name='state', search_controller='turbogears.widgets.AutoCompleteField/search', result_name='states', field_class='autocompletefield', only_suggest=False, search_param='statename', attrs={}))>
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cphttptools.py", line 106, in _run
    self.main()
  File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cphttptools.py", line 255, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in search
  File "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/controllers.py", line 206, in expose
    output = database.run_with_transaction(expose._expose,func, accept, allow_json, allow_json_from_config,*args, **kw)
  File "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/database.py", line 216, in run_with_transaction
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/controllers.py", line 223, in <lambda>
    lambda _func, accept,  allow_json, allow_json_from_config,*args, **kw: _execute_func(
  File "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/controllers.py", line 250, in _execute_func
    output = errorhandling.try_call(func, *args, **kw)
  File "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/errorhandling.py", line 71, in try_call
    output = func(self, *args, **kw)
TypeError: search() got an unexpected keyword argument 'tg_format'

This was tested with:

TurboGears 0.9a5dev-r1108
nose 0.8.4
RuleDispatch 0.5a0
setuptools 0.6a11
FormEncode 0.4
cElementTree 1.0.5-20051216
PasteScript 0.5
elementtree 1.2.6
simplejson 1.1
SQLObject 0.7.1dev-r1682
CherryPy 2.2.0
TurboKid 0.9.4dev-r1090
TurboJson 0.9.2dev-r1093
PyProtocols 1.0a0
Cheetah 1.0
PasteDeploy 0.3
Paste 0.5
FormEncode 0.4
kid 0.9
elementtree 1.2.6

Change History

comment:1 Changed 12 years ago by simon

Any better with [1113]?

comment:2 Changed 12 years ago by godoy

  • Status changed from new to closed
  • Resolution set to fixed

Yes, this fixed it. I'll open a new bug on the other widget, when you open the toolbox page. ;-)

Thanks Simon!

comment:3 Changed 12 years ago by michele

Yeah!

This never happened on my machine, I'm happy now!

michele@ionic:~/Progetti/TurboGears/svn/turbogears$ nosetests
....................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 196 tests in 16.706s

OK

Thanks Simon!

Note: See TracTickets for help on using tickets.