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 #941 (closed defect: wontfix)

Opened 13 years ago

Last modified 12 years ago

render() in view processing assumes a cherrypy response exists

Reported by: tlesher@… Owned by: max
Priority: normal Milestone:
Component: TurboGears Version: 0.9a6
Severity: normal Keywords:
Cc:

Description

If you try to use turbogears.view.render() outside the context of a cherrypy request (for example, when using Kid to write files or generate email), render() throws an exception when it tries to set cherrypy.response.headersContent-Type?.

Wrapping the access of cherrypy.response in a try/except/else clause would solve the issue.

Change History

comment:1 Changed 13 years ago by max

  • Status changed from new to assigned
  • Owner changed from anonymous to max

comment:2 Changed 13 years ago by max

  • Status changed from assigned to closed
  • Resolution set to wontfix

I believe turbogears.view.render can be left as is, assuming a cherrypy request is available. OTOH, having another function to render a template outside of web-request content is certainly welcome. I posted this as a new ticket, #943.

Note: See TracTickets for help on using tickets.