Opened 14 years ago

Closed 14 years ago

#431 closed Defect (Fixed)

Methods in Python scripts are sometimes called with fewer arguments than they expect

Reported by: Mark Rowe <mark+colloquy@…> Owned by: timothy
Component: Colloquy (Mac) Version: 2.0 (Mac)
Severity: Minor Keywords: python
Cc:

Description

When initially signing in -[JVPythonChatPlugin performNotification:withContextInfo:andPreferences:] is called with it's final argument as nil. In this instance, the argument array is created with one fewer element than expected. Because of this the Python function is called with one fewer argument and a Python exception is raised. Similar behaviour is exhibited by other functions.

There are two approaches to solving this problem, one of which may not be an option: if it is only ever the final argument that is nil it would be possible for the Python script to have a default value for its final argument:

def performNotification(notification, context, preferences=None):
    ...

If earlier arguments may be nil then the code that converts from Obj-C to Python arguments needs to be smartened up to deal with this case.

Change History (1)

comment:1 Changed 14 years ago by timothy

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

Fixed in [3068].

Note: See TracTickets for help on using tickets.