Opened 3 years ago

Closed 3 years ago

#13132 closed defect (fixed)

citecode macro not playing nice with other repo links

Reported by: christiano@… Owned by: Ryan J Ollos
Priority: normal Component: CiteCodeMacro
Severity: normal Keywords:
Cc: Trac Release: 1.0


I believe that the macro breaks when other repository link(s) come after the macro. It appears to work normally when the other repo links are before the macro on the wiki page.

This seems to work fine:

[[source:HG_REPO_NAME/path/file|Link Name]]

But this:

[[source:HG_REPO_NAME/path/file|Link Name]]

Causes the following error "Trac detected an internal error: TypeError: object of type 'NoneType' has no len()"

File "/usr/lib/python2.7/dist-packages/trac/wiki/templates/wiki_edit.html", line 161, in <Expression u'wiki_to_html(context.child(page.resource), page.text)'>
File "/usr/lib/python2.7/dist-packages/trac/wiki/", line 1546, in format_to_html
File "/usr/lib/python2.7/dist-packages/trac/wiki/", line 1501, in generate
File "/usr/lib/python2.7/dist-packages/trac/wiki/", line 1283, in format
File "/usr/lib/python2.7/", line 151, in sub
File "/usr/lib/python2.7/dist-packages/trac/wiki/", line 1201, in replace
File "/usr/lib/python2.7/dist-packages/trac/wiki/", line 1197, in handle_match
File "/usr/lib/python2.7/dist-packages/trac/wiki/", line 754, in _macrolink_formatter
File "/usr/lib/python2.7/dist-packages/trac/wiki/", line 591, in _lhref_formatter
File "/usr/lib/python2.7/dist-packages/trac/wiki/", line 626, in _make_lhref_link
File "/usr/lib/python2.7/dist-packages/trac/wiki/", line 637, in _make_link
File "/usr/lib/python2.7/dist-packages/trac/versioncontrol/web_ui/", line 798, in _format_browser_link
File "/usr/lib/python2.7/dist-packages/trac/versioncontrol/web_ui/", line 819, in _get_link_info
File "/usr/lib/python2.7/dist-packages/trac/versioncontrol/web_ui/", line 86, in get_allowed_node
File "build/bdist.linux-x86_64/egg/tracext/hg/", line 775, in get_node
File "build/bdist.linux-x86_64/egg/tracext/hg/", line 606, in changectx
File "build/bdist.linux-x86_64/egg/tracext/hg/", line 632, in short_rev

Attachments (0)

Change History (3)

comment:1 Changed 3 years ago by christiano@…

I should mention that I am currently working with TracCiteCode 0.3.0

comment:2 Changed 3 years ago by Ryan J Ollos

Owner: changed from tkob-trac to Ryan J Ollos
Status: newaccepted

Confirmed. The issue is caused by calling repos.close().

comment:3 Changed 3 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 16421:

TracCiteCode 0.3.4: Don't close repository in macro

Fixes #13132.

Modify Ticket

Change Properties
Set your email in Preferences
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.