Modify

Opened 15 years ago

Closed 5 years ago

#4172 closed defect (fixed)

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 15 years ago.
wiki page exported from MediaWiki which breaks Trac+MediawikiPlugin
allow_lessthan.patch (783 bytes) - added by anonymous 13 years ago.
patch to prevent runtime error if the mediawiki macro encountered a less-than ("<") sign

Download all attachments as: .zip

Change History (9)

Changed 15 years ago by anonymous

Attachment: Angriff added

wiki page exported from MediaWiki which breaks Trac+MediawikiPlugin

comment:1 Changed 15 years ago by flemaitre

Trac Release: 0.110.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'
Last edited 5 years ago by Ryan J Ollos (previous) (diff)

Changed 13 years ago by anonymous

Attachment: allow_lessthan.patch added

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

comment:2 Changed 13 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 13 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.)

comment:4 Changed 5 years ago by Chad Trytten

Running Trac 1.2.3; confirmed that applying the above patch prior to plugin install corrects the identified issue, which was blocking essentially every MediaWiki import for us.

comment:5 Changed 5 years ago by Ryan J Ollos

In 17386:

TracMediaWikiMacro 1.1dev: Applied patch attached to wiki page

Refs #4172.

comment:6 Changed 5 years ago by Ryan J Ollos

In 17387:

TracMediaWikiMacro 1.1dev: Fix parsing error for <

Refs #4172.

comment:7 Changed 5 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain permon.
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.