Opened 12 years ago
Closed 12 years ago
#11658 closed defect (fixed)
TypeError: get_tagged_resources() takes exactly 3 arguments (2 given)
| Reported by: | Ryan J Ollos | Owned by: | Steffen Hoffmann |
|---|---|---|---|
| Priority: | normal | Component: | TagsPlugin |
| Severity: | normal | Keywords: | |
| Cc: | Jun Omae | Trac Release: | 1.0 |
Description
Running 0.7dev-r13797 of TagsPlugin, I tried to add the following to a wiki page:
[tag:bsd-license], [tag:apache-license], [tag:gpl-license], [tag:mit-license].
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/wiki/templates/wiki_edit.html", line 161, in <Expression u'wiki_to_html(context.child(page.resource), page.text)'>
${wiki_to_html(context.child(page.resource), page.text)}
File "/srv/trac-hacks.org/pve/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 "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/wiki/formatter.py", line 1501, in generate
escape_newlines)
File "/srv/trac-hacks.org/pve/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/lib/python2.6/re.py", line 151, in sub
return _compile(pattern, 0).sub(repl, string, count)
File "/srv/trac-hacks.org/pve/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 "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/wiki/formatter.py", line 1197, in handle_match
return internal_handler(match, fullmatch)
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/wiki/formatter.py", line 591, in _lhref_formatter
return self._make_lhref_link(match, fullmatch, rel, ns, target, label)
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/wiki/formatter.py", line 626, in _make_lhref_link
fullmatch)
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/Trac-1.0.1-py2.6.egg/trac/wiki/formatter.py", line 635, in _make_link
fullmatch)
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracTags-0.7dev_r13797-py2.6.egg/tractags/wiki.py", line 342, in _format_tagged
if target in tag_sys.get_all_tags(formatter.req) or \
File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracTags-0.7dev_r13797-py2.6.egg/tractags/api.py", line 398, in get_all_tags
for resource, tags in provider.get_tagged_resources(req):
Attachments (0)
Change History (10)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
The issue occurred on t-h.o. The first possibility that comes to mind is FullBlogPlugin. It seem to remember dealing with this issue in FullBlogPlugin a while ago. I'll check if our installation just needs an update.
Either way, your idea to log or possibly trap the error with a better message seems like a good one.
comment:3 Changed 12 years ago by
Installing FullBlogPlugin r13462 seems to have fixed the issue: tag:bsd-license. Thanks!
comment:5 Changed 12 years ago by
Extra effort for re-testing the older plugin with r13799 for confirmation of the interim fix would be welcome, but as I cannot find another obsolete ITagProvider implementation on t-h.o I wonder, if we really need that extra try-catch for production.
comment:6 Changed 12 years ago by
Hm, extra robustness cannot hurt. I'll think it over, hear to your thoughts and decide tomorrow.
comment:8 Changed 12 years ago by
I tested with TagsPlugin 0.7dev-r13800 and FullBlogPlugin 0.1.1-r13461:
08:10:21 PM Trac[chrome] DEBUG: Prepare chrome data for request 08:10:22 PM Trac[api] DEBUG: Skip erroneous ITagProvider <tracfullblog.tags.FullBlogTagSystem object at 0x7fb5c8c52890> 127.
It works well, and seems to be useful for the cases that a user hasn't updated their FullBlogPlugin to r13462. It might be worthwhile to add a comment explaining the purpose of the try/except, and mention that it could eventually be removed.



I cannot reproduce this for tag providers (ticket, wiki), that come bundled with the plugin.
By chance: Do you have any other plugin with its own, probably outdated
ITagProviderimplementation? I'll add some DEBUG logging to catch that with next (interim) changes.