Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#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:


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/", 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/", line 364, in process
    text = self.processor(text)
  File "/srv/virtualenv/local/lib/python2.7/site-packages/trac/wiki/", line 348, in _macro_processor
    text, self.args)
  File "/srv/trac_tova/wantedpagesmacro-trunk/wantedpages/", line 187, in expand_macro
  File "/srv/trac_tova/wantedpagesmacro-trunk/wantedpages/", line 30, in format_to_oneliner
    return WantedPagesHtmlFormatter(env, context, wikidom).generate(shorten)
  File "/srv/trac_tova/wantedpagesmacro-trunk/wantedpages/", line 129, in generate
  File "/srv/virtualenv/local/lib/python2.7/site-packages/trac/wiki/", line 1437, in format
    result = re.sub(self.wikiparser.rules, self.replace, result)
  File "/srv/virtualenv/lib/python2.7/", line 155, in sub
    return _compile(pattern, flags).sub(repl, string, count)
  File "/srv/virtualenv/local/lib/python2.7/site-packages/trac/wiki/", line 1250, in replace
    replacement = self.handle_match(fullmatch)
  File "/srv/trac_tova/wantedpagesmacro-trunk/wantedpages/", line 114, in handle_match
    return internal_handler(match, fullmatch)
  File "/srv/virtualenv/local/lib/python2.7/site-packages/trac/wiki/", line 786, in _macrolink_formatter
    return self._lhref_formatter(match, fullmatch)
  File "/srv/virtualenv/local/lib/python2.7/site-packages/trac/wiki/", line 616, in _lhref_formatter
    rel ='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)

Change History (3)

comment:1 Changed 3 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

In 17884:

TracWantedPages 0.6dev: Fix malformed markup resulting in exception

Make fetching of wiki pages more efficient.

Fixes #13913.

comment:2 Changed 3 years ago by Ryan J Ollos

In 17885:

TracWantedPages 0.6dev: Fix parsing of anchors in headings

Refs #13913.

comment:3 Changed 3 years ago by Ryan J Ollos

In 17887:

TracWantedPages 0.6: Publish version 0.6

Version 0.6 is r17745.

Bump trunk to 0.7.0dev.

Refs #13913, #13860, #12803.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

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

Note: See TracTickets for help on using tickets.