Opened 7 years ago

Closed 7 years ago

# spamfilter-0.3.2 fails with not enough arguments

Reported by: Owned by: Roy Marples Odd Simon Simonsen high FullBlogPlugin blocker 0.12

### Description

It seems it now needs a fourth argument of an IP address.

### comment:1 Changed 7 years ago by Odd Simon Simonsen

Thanks. As I'm trying to keep the plugin code compatible with both 0.11 and 0.12, I can't quite use the patch as is. I don't have the spamfilter plugin installed myself for any version, but as the change is restricted to just the method signature, here is how I'd write it:

from trac.util import arity
...
if arity(FilterSystem.test) == 4:
# 0.11 compatible method signature
FilterSystem(self.env).test(req, author, changes)
else:
# 0.12+ compatible that adds an 'ip' argument
...


The implicity argument self is part of the argument count for the method, which makes the count 4 and 5 for old and new versions.

If the patch can be updated and confirmed to work with both 0.11 and 0.12 versions, I'll be happy to apply it.

### comment:2 Changed 7 years ago by Odd Simon Simonsen

Resolution: → fixed new → closed

I've just gone ahead and applied this in [8253]. Hope it works for all. Reopen if not.

### Modify Ticket

Change Properties