There seems to be a bug in the way parameters are referenced in python scripts. I have a simple script that has a list as a default parameter. The script then appends something to this list and returns the list. Each time I call the script the list gets to be one element longer. Here is an example script:

## Script (Python) "pyFix"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
return a

The output from the script is as follows:
1st call: ['a','b']
2nd call: ['a','b','b']
3rd call: ['a','b','b','b']
4th call: ['a','b','b','b','b']

It seems that I'm getting a reference to the default parameter which I then modify for future calls. Currently I'm getting around this by having list parameters default to none and then setting the defaults within the script.

I have some security concerns since I can change the default parameters for other users on the server. Or so it seems.


Brian Brinegar
Engineering Computer Network
Purdue University

Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists - )

Reply via email to