[Zope] PythonScript Error Message

Chris Withers chrisw@nipltd.com
Sun, 25 Mar 2001 12:53:48 +0100


"Farrell, Troy" wrote:
> 
> Error Type: TypeError
> Error Value: keyword parameter redefined

A simple example of when you get this:

def x(y,z):
  print y,z

>>> x(2,y=1)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: keyword parameter redefined

> logfile_line_id = context.sqlStreamInsertIntoRealRaw(eventId = eventId,
<snip>
> presentation_id)

Aaaaagh! For your own sanity, please consider building up a dictionary:

request = {}
request['eventId'] = ...
...etc...

And then call your ZSQL method like:
logfile_line_id = context.sqlStreamInsertIntoRealRaw(request)

...you'll probably find you remove the above error that way and your code will
be a _lot_ more readable ;-)

cheers,

Chris