I have an odd and very intermittent problem in Python script. Occasionally it fails with this error:
Traceback (most recent call last): File "/Applications/APO/TTUI.app/Contents/Resources/lib/python2.7/TUI/Base/Bas eFocusScript.py", line 884, in run File "/Applications/APO/TTUI.app/Contents/Resources/lib/python2.7/TUI/Base/Bas eFocusScript.py", line 1690, in initAll TypeError: unbound method initAll() must be called with BaseFocusScript instance as first argument (got ScriptClass instance instead) self=<ScriptClass object at 0x2066b410>; class hierarchy=[(<class 'TUI.Base.BaseFocusScript.ImagerFocusScript'>, (<class 'TUI.Base.BaseFocusScript.BaseFocusScript'>,)), [(<class 'ScriptClass'>, (<class 'TUI.Base.BaseFocusScript.ImagerFocusScript'>,))]] The code looks like this: def run(self, sr): try: self.initAll() .... except Exception: traceback.print_exc(file=sys.stderr) sys.stderr.write("self=%r; class hierarchy=%s\n" % (self, inspect.getclasstree([type(self)]))) raise As a detail that may be important: the code is a generator that is being run by a script runner class (an instance of which is passed into the run function as argument sr). When the user starts a script the script runner calls the script's "run" generator. The script runner calls the run generator again later when conditions are right (e.g. data that is being waited for arrives, a time limit is reached...). In this case the failure occurs at the very start of the script, so a yield has not yet executed. I am puzzled why Python thinks the class type is wrong, given the output of inspect.getclasstree. Any ideas on what might be wrong and how to track it down (and why it would be so intermittent)? -- Russell -- http://mail.python.org/mailman/listinfo/python-list