Modify ↓
#13913 closed defect (fixed)
Malformed markup leads to exception
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | WantedPagesMacro |
Severity: | normal | Keywords: | |
Cc: | Trac Release: |
Description
2020-11-30 22:13:40,914 Trac[formatter] ERROR: Macro WantedPages(show_referrers) failed for <Resource u'wiki:Tova8/specifications/WHQL_Process'>: Traceback (most recent call last): File "/srv/virtualenv/local/lib/python2.7/site-packages/trac/wiki/formatter.py", line 800, in _macro_formatter return macro.ensure_inline(macro.process(args), in_paragraph) File "/srv/virtualenv/local/lib/python2.7/site-packages/trac/wiki/formatter.py", line 364, in process text = self.processor(text) File "/srv/virtualenv/local/lib/python2.7/site-packages/trac/wiki/formatter.py", line 348, in _macro_processor text, self.args) File "/srv/trac_tova/wantedpagesmacro-trunk/wantedpages/macro.py", line 187, in expand_macro _text)) File "/srv/trac_tova/wantedpagesmacro-trunk/wantedpages/macro.py", line 30, in format_to_oneliner return WantedPagesHtmlFormatter(env, context, wikidom).generate(shorten) File "/srv/trac_tova/wantedpagesmacro-trunk/wantedpages/macro.py", line 129, in generate shorten) File "/srv/virtualenv/local/lib/python2.7/site-packages/trac/wiki/formatter.py", line 1437, in format result = re.sub(self.wikiparser.rules, self.replace, result) File "/srv/virtualenv/lib/python2.7/re.py", line 155, in sub return _compile(pattern, flags).sub(repl, string, count) File "/srv/virtualenv/local/lib/python2.7/site-packages/trac/wiki/formatter.py", line 1250, in replace replacement = self.handle_match(fullmatch) File "/srv/trac_tova/wantedpagesmacro-trunk/wantedpages/macro.py", line 114, in handle_match return internal_handler(match, fullmatch) File "/srv/virtualenv/local/lib/python2.7/site-packages/trac/wiki/formatter.py", line 786, in _macrolink_formatter return self._lhref_formatter(match, fullmatch) File "/srv/virtualenv/local/lib/python2.7/site-packages/trac/wiki/formatter.py", line 616, in _lhref_formatter rel = fullmatch.group('rel') AttributeError: 'NoneType' object has no attribute 'group'
Malformed markup such as [[url|label]
(no closing bracket), leads to the issue.
It seems that OneLinerFormatter
is not sufficient to format the content and Formatter
should be used instead. The fetching of wiki pages can also be made more efficient.
Attachments (0)
Note: See
TracTickets for help on using
tickets.
In 17884: