Modify

Opened 5 years ago

Last modified 3 years ago

#4172 new defect

MediaWikiPlugin raises AttributeError: 'NoneType' object has no attribute 'groups'

Reported by: anonymous Owned by: permon
Priority: normal Component: MediaWikiPluginMacro
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

While displaying a wiki page, which begins with calling the MediaWiki renderer and ends with closing it, trac raises a AttributeError: 'NoneType' object has no attribute 'groups'

I'll try to attach the broken wikipage which can be loaded with trac-admin . wiki load /tmp/directory where that file relies in /tmp/directory.

Attachments (2)

Angriff (2.7 KB) - added by anonymous 5 years ago.
wiki page exported from MediaWiki which breaks Trac+MediawikiPlugin
allow_lessthan.patch (783 bytes) - added by anonymous 3 years ago.
patch to prevent runtime error if the mediawiki macro encountered a less-than ("<") sign

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by anonymous

wiki page exported from MediaWiki which breaks Trac+MediawikiPlugin

comment:1 Changed 5 years ago by flemaitre

  • Trac Release changed from 0.11 to 0.10

Hi,

i've the same problem.

Somebody have a solution at this error ?

Thanks

Florent

Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/trac/web/main.py", line 387, in dispatch_request
    dispatcher.dispatch(req)
  File "/var/lib/python-support/python2.5/trac/web/main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "/var/lib/python-support/python2.5/trac/wiki/web_ui.py", line 135, in process_request
    self._render_view(req, db, page)
  File "/var/lib/python-support/python2.5/trac/wiki/web_ui.py", line 444, in _render_view
    'page_html': wiki_to_html(page.text, self.env, req),
  File "/var/lib/python-support/python2.5/trac/wiki/formatter.py", line 999, in wiki_to_html
    Formatter(env, req, absurls, db).format(wikitext, out, escape_newlines)
  File "/var/lib/python-support/python2.5/trac/wiki/formatter.py", line 793, in format
    self.handle_code_block(line)
  File "/var/lib/python-support/python2.5/trac/wiki/formatter.py", line 733, in handle_code_block
    self.req, self.code_text)))
  File "/var/lib/python-support/python2.5/trac/wiki/formatter.py", line 112, in process
    text = self.processor(req, text)
  File "/var/lib/python-support/python2.5/trac/wiki/formatter.py", line 100, in _macro_processor
    return self.macro_provider.render_macro(req, self.name, text)
  File "build/bdist.linux-i686/egg/mediawiki/mediawiki.py", line 32, in render_macro
    return self.expand_macro(None, name, content)
  File "build/bdist.linux-i686/egg/mediawiki/mediawiki.py", line 28, in expand_macro
    return parse(content)
  File "build/bdist.linux-i686/egg/mediawiki/parser.py", line 2450, in parse
    text = removeHtmlTags(text)
  File "build/bdist.linux-i686/egg/mediawiki/parser.py", line 274, in removeHtmlTags
    slash, t, params, brace, rest = m.groups()
AttributeError: 'NoneType' object has no attribute 'groups'

Changed 3 years ago by anonymous

patch to prevent runtime error if the mediawiki macro encountered a less-than ("<") sign

comment:2 follow-up: Changed 3 years ago by anonymous

allow_lessthan.patch fixed the problem for me. The problem occurred whenever the mediawiki processor would encounter a "<" in your text.

comment:3 in reply to: ↑ 2 Changed 3 years ago by anonymous

Replying to anonymous:

allow_lessthan.patch fixed the problem for me. The problem occurred whenever the mediawiki processor would encounter a "<" in your text.

Oh and BTW, I am running Trac 0.12.2. (I see this ticket is against 0.10.)

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.