Modify

Opened 4 years ago

Closed 4 years ago

#7329 closed defect (fixed)

spamfilter-0.3.2 fails with not enough arguments

Reported by: roy 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 4 years ago.
Add IP address to fix
patch-aa.2 (889 bytes) - added by roy 4 years ago.
Add IP address to fix

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by roy

Add IP address to fix

Changed 4 years ago by roy

Add IP address to fix

comment:1 Changed 4 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 4 years ago by osimons

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Action
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.