Ticket #7329 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

spamfilter-0.3.2 fails with not enough arguments

Reported by: roy Assigned to: osimons
Priority: high Component: FullBlogPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.12

Description

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

Attachments

patch-aa (0.9 kB) - added by roy on 07/05/10 00:13:00.
Add IP address to fix
patch-aa.2 (0.9 kB) - added by roy on 07/05/10 00:14:16.
Add IP address to fix

Change History

07/05/10 00:13:00 changed by roy

  • attachment patch-aa added.

Add IP address to fix

07/05/10 00:14:16 changed by roy

  • attachment patch-aa.2 added.

Add IP address to fix

07/08/10 22:52:17 changed by osimons

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
    FilterSystem(self.env).test(req, author, changes, req.remote_addr)
...

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.

07/11/10 23:09:06 changed by osimons

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #7329 (spamfilter-0.3.2 fails with not enough arguments)




Change Properties
Action