#11033 closed defect (fixed)
sub_vars() chokes on None values
Reported by: | anonymous | Owned by: | Remy Blank |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.1 |
Component: | general | Version: | 1.1.1dev |
Severity: | normal | Keywords: | |
Cc: | ryan.j.ollos@… | Branch: | |
Release Notes: |
Handle case of report description being |
||
API Changes: | |||
Internal Changes: |
Description
How to Reproduce
While doing a GET operation on /report/1
, Trac issued an internal error.
(please provide additional details here)
Request parameters:
{'id': u'1'}
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4
System Information
System information not available
Enabled Plugins
Plugin information not available
Python Traceback
Traceback (most recent call last): File "/usr/local/virtualenv/1.1dev/lib/python2.6/site-packages/Trac-1.1.1dev_r11538-py2.6.egg/trac/web/main.py", line 497, in _dispatch_request dispatcher.dispatch(req) File "/usr/local/virtualenv/1.1dev/lib/python2.6/site-packages/Trac-1.1.1dev_r11538-py2.6.egg/trac/web/main.py", line 214, in dispatch resp = chosen_handler.process_request(req) File "/usr/local/virtualenv/1.1dev/lib/python2.6/site-packages/Trac-1.1.1dev_r11538-py2.6.egg/trac/ticket/report.py", line 181, in process_request template, data, content_type = self._render_view(req, id) File "/usr/local/virtualenv/1.1dev/lib/python2.6/site-packages/Trac-1.1.1dev_r11538-py2.6.egg/trac/ticket/report.py", line 427, in _render_view 'description': sub_vars(description, args), File "/usr/local/virtualenv/1.1dev/lib/python2.6/site-packages/Trac-1.1.1dev_r11538-py2.6.egg/trac/util/text.py", line 722, in sub_vars return sub_vars_re.sub(repl, text) TypeError: expected string or buffer
Attachments (0)
Change History (4)
comment:1 by , 12 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
Summary: | Test test → sub_vars() chokes on None values |
comment:2 by , 12 years ago
Milestone: | → 1.1.1 |
---|---|
Version: | → 1.1.1dev |
comment:3 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Ah, no, let's keep sub_vars()
as requiring a string argument. The title is already guaranteed to be a string, so only the description could be NULL
. Fixed in [11642].
comment:4 by , 12 years ago
Cc: | added |
---|---|
Release Notes: | modified (diff) |
Is this an actual issue? It looks so, but the title is misleading.
Anyway, my best guess with the limited information available is that the
description
field isNULL
. We should probably catch this case insub_vars()
to be more robust.