Modify

Opened 14 years ago

Closed 14 years ago

#7329 closed defect (fixed)

spamfilter-0.3.2 fails with not enough arguments

Reported by: Roy Marples Owned by: 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 (2)

patch-aa (889 bytes) - added by Roy Marples 14 years ago.
Add IP address to fix
patch-aa.2 (889 bytes) - added by Roy Marples 14 years ago.
Add IP address to fix

Download all attachments as: .zip

Change History (4)

Changed 14 years ago by Roy Marples

Attachment: patch-aa added

Add IP address to fix

Changed 14 years ago by Roy Marples

Attachment: patch-aa.2 added

Add IP address to fix

comment:1 Changed 14 years ago 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.

comment:2 Changed 14 years ago by osimons

Resolution: fixed
Status: newclosed

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

Modify Ticket

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