Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11434 closed defect (fixed)

TypeError: get_tagged_resources() takes exactly 3 arguments (2 given) 0.7dev_r13434

Reported by: einsiedlerkrebs@… Owned by: Steffen Hoffmann
Priority: normal Component: TagsPlugin
Severity: minor Keywords:
Cc: Trac Release: 1.0

Description

for TracTag trunk 0.7dev_r13434-

We expirienced an error in trac installation Trac 1.0.1 wheezy packports.

fixed in Fallback for older provider section in function get_all_tags

root@example /usr/local/lib/python2.7/dist-packages/TracTags-0.7dev_r13434-py2.7.egg/tractags $ diff -u api.py.dist api.py | colordiff
--- api.py.dist    2013-12-08 15:30:30.000000000 +0100
+++ api.py    2013-12-08 15:40:46.000000000 +0100
@@ -378,7 +378,7 @@
                     all_tags += provider.get_all_tags(req)
                 except AttributeError:
                     # Fallback for older providers.
-                    for resource, tags in provider.get_tagged_resources(req):
+                    for resource, tags in provider.get_tagged_resources(req, None):
                         all_tags.update(tags)
         return all_tags 

Attachments (0)

Change History (7)

comment:1 Changed 11 years ago by Steffen Hoffmann

Thanks for reporting your observation. What ITagProvider throws that exception?

You patch is a work-around for a provider, that does not strictly conform to the tag provider interface definition (see the ITagProvider class definition in tractags/api.py). I'd see that fixed rather than the call inside TagSystem. Huch, I just see, that even DefaultTagProvider has such a bad method signature - will change that right now.

comment:2 Changed 11 years ago by Steffen Hoffmann

In 13461:

TagsPlugin: Make tag providers conform to interface definition, refs #11434.

comment:3 Changed 11 years ago by Steffen Hoffmann

The changes in r13461 will fix the issue for ScreenshotsPlugin too, because its tag provider inherits the get_tagged_resources from tractags.api.DefaultTagProvider. I filed ticket #11435 against FullBlogPlugin to fix it for the only other plugin I'm aware of (searching only t-h.o, YMMV).

comment:4 Changed 11 years ago by amo@…

Funny enough, we did the same amends you did with [13461] first, but to no avail. But now it's perfectly clear: In fact we have FullBlogPlugin installed but failed in reasoning this was the culprit in this case.

We will check with current trunk and fix for FullBlogPlugin from patch of #11435 tomorrow.

Thanks a bunch!

comment:5 in reply to:  2 ; Changed 11 years ago by osimons

Replying to hasienda:

In 13461: TagsPlugin: Make tag providers conform to interface definition, refs #11434.

Why leave out the filter=Noneargument for the ticket implementation? If filter is part of API, then surely all implementations should also be able to handle it as input?

BTW, #11435 is now fixed so just refresh to latest FullBlogPlugin source.

comment:6 Changed 11 years ago by einsiedlerkrebs@…

Resolution: fixed
Status: newclosed

Hey, i tested it as well. It is working. Thanks a lot. That was fast. Thanks

comment:7 in reply to:  5 Changed 11 years ago by Steffen Hoffmann

Replying to osimons:

Replying to hasienda:

In 13461: TagsPlugin: Make tag providers conform to interface definition, refs #11434.

Why leave out the filter=Noneargument for the ticket implementation? If filter is part of API, then surely all implementations should also be able to handle it as input?

Agreed. This has been fixed in [13799].

Modify Ticket

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