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 #1024 (closed defect: invalid)

Opened 13 years ago

Last modified 12 years ago

using tg_format broken for html/xml

Reported by: wavy Owned by: anonymous
Priority: normal Milestone:
Component: CherryPy Version: 0.9a6
Severity: normal Keywords: tg_format


On a fresh quickstart project, with no changes, the request


gives the traceback Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 105, in _run


File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 254, in main

body = page_handler(*virtual_path, self.params)

File "<string>", line 3, in index File "/usr/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/controllers.py", line 273, in expose

output = database.run_with_transaction(

File "/usr/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/database.py", line 221, in run_with_transaction

retval = func(*args, kw)

File "<string>", line 5, in _expose File "_speedups.pyx", line 376, in _speedups.BaseDispatcher?.getitem File "build/bdist.linux-i686/egg/dispatch/interfaces.py", line 15, in callNoApplicableMethods: ((<function index at 0xb766ccdc>, 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', False, (<tgtest2.controllers.Root object at 0xb7683bac>,), {'tg_format': u'html'}), {})

tg_format=json works fine, but html does not. Looks like a generic function error I think.

Change History

comment:1 Changed 13 years ago by elvelind

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

This is the correct behavior (or atleast the currently expected one). tg_format is for changing between output formats defined by using multiple expose decorators.

@expose("json") @expose("kidtemplate")

xhtml/html on the other hand is a format argument sent to that template engine. ie to tell kid to render kidtemplate to xhtml or whatever.

Note: See TracTickets for help on using tickets.