Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#4722 closed defect (fixed)

post_process_request not preserve content_type, which cause text/plain templates fail to render.

Reported by: jiangxin Owned by: jiangxin
Priority: highest Component: TracCoSignPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.11


post_process_request in traccosign/ carelessly set content_type to None. It's bad if template is not a html template but a text template.

This bug cause plain text output of source code revision log raise a exception:

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/trac/web/", line 459, in _dispatch_request
  File "/usr/lib/python2.5/site-packages/trac/web/", line 237, in dispatch
  File "/usr/lib/python2.5/site-packages/trac/web/", line 740, in render_template
    template = self.load_template(filename, method=method)
  File "/usr/lib/python2.5/site-packages/trac/web/", line 724, in load_template
    return self.templates.load(filename, cls=cls)
  File "/var/lib/python-support/python2.5/genshi/template/", line 227, in load
    filename, encoding=encoding)
  File "/var/lib/python-support/python2.5/genshi/template/", line 265, in _instantiate
  File "/var/lib/python-support/python2.5/genshi/template/", line 67, in __init__
  File "/var/lib/python-support/python2.5/genshi/template/", line 406, in __init__
    raise TemplateSyntaxError(e.msg, self.filepath, e.lineno, e.offset)
TemplateSyntaxError: not well-formed (invalid token): line 1, column 1 (/usr/lib/python2.5/site-packages/trac/versioncontrol/templates/revisionlog.txt, line 1)

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by jiangxin

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

(In [5325]) Fixed #4722: wrong content_type return value from post_process_request.

comment:2 Changed 5 years ago by jiangxin

(In [5326]) Upgrade to 0.1.2-1.5325. See #4722.

Add Comment

Modify Ticket

as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from jiangxin. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.