On Wednesday 27 September 2006 12:49, you wrote:
paramString = func[ func.find("(")+1 : func.rfind(")") ]
paramList = [eval(x) for x in paramString.split(",")]
getattr(target_object, func)(*paramList)
We still have to use eval(), but that's much safer right? Is there
anyway to do malicious things with eval()?
Well, I just tried your code with
func = "Move(os.remove('file'), 0.280000)"
and the os.remove got executed, so very probably. Couldn't we just use
float(). I know some of the params are ints but is there anywhere where this
matters?