Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11324 closed defect (fixed)

AttributeError: 'NoneType' object has no attribute 'id' error when enabling textbox

Reported by: anonymous Owned by: matobaa
Priority: normal Component: TracLinksPlugin
Severity: normal Keywords: svn, repository, changeset
Cc: Trac Release: 1.0

Description

Currently the TracLinksPlugin is the only plugin I have enabled. When I set traclinks.textbox.textbox = enabled, I get the following error message when I navigate to changesets in which the log message contains a revision TracLink (ex. r5245, etc.):

2013-09-17 17:16:53,998 Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/web/main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/web/main.py", line 233, in dispatch
    content_type)
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/web/chrome.py", line 1015, in render_template
    encoding='utf-8')
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/core.py", line 184, in render
    return encode(generator, method=method, encoding=encoding, out=out)
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/output.py", line 58, in encode
    for chunk in iterator:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/output.py", line 350, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/output.py", line 829, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/output.py", line 669, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/output.py", line 774, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/output.py", line 594, in __call__
    for ev in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/core.py", line 289, in _ensure
    for event in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/core.py", line 289, in _ensure
    for event in stream:
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/web/chrome.py", line 1152, in _strip_accesskeys
    for kind, data, pos in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/core.py", line 289, in _ensure
    for event in stream:
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/web/chrome.py", line 1141, in _generate
    for kind, data, pos in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/core.py", line 289, in _ensure
    for event in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/core.py", line 289, in _ensure
    for event in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/filters/transform.py", line 706, in _unmark
    for mark, event in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/filters/transform.py", line 1195, in __call__
    for mark, (kind, data, pos) in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/filters/transform.py", line 1195, in __call__
    for mark, (kind, data, pos) in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/filters/transform.py", line 734, in __call__
    for mark, event in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/filters/transform.py", line 702, in _mark
    for event in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/template/base.py", line 618, in _include
    for event in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/template/markup.py", line 378, in _match
    ctxt, start=idx + 1, **vars):
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/template/markup.py", line 378, in _match
    ctxt, start=idx + 1, **vars):
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/template/markup.py", line 362, in _match
    content = list(content)
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/template/base.py", line 618, in _include
    for event in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/template/markup.py", line 326, in _match
    for event in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/template/markup.py", line 315, in _strip
    event = next()
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/template/base.py", line 558, in _flatten
    for kind, data, pos in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/core.py", line 289, in _ensure
    for event in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/path.py", line 588, in _generate
    subevent = next()
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/template/base.py", line 618, in _include
    for event in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/template/markup.py", line 315, in _strip
    event = next()
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/template/base.py", line 558, in _flatten
    for kind, data, pos in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/core.py", line 289, in _ensure
    for event in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/path.py", line 588, in _generate
    subevent = next()
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/template/base.py", line 618, in _include
    for event in stream:
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/template/markup.py", line 315, in _strip
    event = next()
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/template/base.py", line 578, in _flatten
    result = _eval_expr(data, ctxt, vars)
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/template/base.py", line 289, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/template/eval.py", line 177, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/versioncontrol/templates/changeset.html", line 160, in <Expression u'wiki_to_html(context, changeset.message, escape_newlines=True)'>
    ${wiki_to_html(context, changeset.message, escape_newlines=True)}
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/wiki/formatter.py", line 1546, in format_to_html
    return HtmlFormatter(env, context, wikidom).generate(escape_newlines)
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/wiki/formatter.py", line 1501, in generate
    escape_newlines)
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/wiki/formatter.py", line 1283, in format
    result = re.sub(self.wikiparser.rules, self.replace, line)
  File "/usr/lib64/python2.6/re.py", line 151, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/wiki/formatter.py", line 1201, in replace
    replacement = self.handle_match(fullmatch)
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/wiki/formatter.py", line 1194, in handle_match
    return external_handler(self, match, fullmatch)
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/versioncontrol/web_ui/changeset.py", line 1060, in <lambda>
    y, z))
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/versioncontrol/web_ui/changeset.py", line 1084, in _format_changeset_link
    reponame = rm.get_default_repository(formatter.context)
  File "/usr/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/versioncontrol/api.py", line 588, in get_default_repository
    return context.resource.parent.id
AttributeError: 'NoneType' object has no attribute 'id'

Changesets that don't contain a revision TracLink have no issue loading. When I set traclinks.textbox.textbox = disabled in my trac.ini, the issue goes away.

Attachments (0)

Change History (4)

comment:1 Changed 11 years ago by matobaa

Status: newassigned

comment:2 Changed 11 years ago by matobaa

In 13388:

TracLinksPlugin: refs #11324 Quick hacked to avoid error, not fixed yet

comment:3 Changed 11 years ago by matobaa

Resolution: fixed
Status: assignedclosed

comment:4 Changed 11 years ago by matobaa

Thank you for your kind report!

Modify Ticket

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