Modify

Opened 12 months ago

Closed 11 months ago

Last modified 11 months 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 11 months 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 11 months 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 11 months 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.

Add Comment


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

 
Note: See TracTickets for help on using tickets.