Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12996 closed defect (fixed)

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

Reported by: jabberz Owned by: Ryan J Ollos
Priority: normal Component: MarkdownMacro
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

2016-12-13 14:17:33,789 Trac[formatter] ERROR: Processor Markdown failed:
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/trac/wiki/formatter.py", line 1188, in _exec_processor
    return processor.process(text)
  File "build/bdist.linux-x86_64/egg/trac/wiki/formatter.py", line 362, in process
    text = self.processor(text)
  File "build/bdist.linux-x86_64/egg/trac/wiki/formatter.py", line 349, in _macro_processor
    text)
  File "build/bdist.linux-x86_64/egg/Markdown/macro.py", line 74, in expand_macro
    return markdown(re.sub(LINK, convert, content), ['tables'])
  File "/usr/lib/python2.7/re.py", line 155, in sub
    return _compile(pattern, flags).sub(repl, string, count)
  File "build/bdist.linux-x86_64/egg/Markdown/macro.py", line 65, in convert
    url = re.search(HREF, out_value).groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'

I modify it to this, it worked fine:

65c65,68
<                 url = re.search(HREF, out_value).groups()[0]
---
>                 try:
>                     url = re.search(HREF, out_value).groups()[0]
>                 except:
>                     url = ""

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by Ryan J Ollos

It would be useful to see the markdown that led to the exception so that I could reproduce the issue locally.

comment:2 Changed 8 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

In 16092:

0.11.5: Handle case in which HREF regex does not find a match

Fixes #12996.

comment:3 Changed 8 years ago by Ryan J Ollos

Please test the latest and kindly report back whether it's working for you now. Thanks!

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.