Modify

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:

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)

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
Action
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.