Hello all, Working with py-appscript to automate testing and I'm getting an error deep in aemreference/aemcodecs. Following are the trace and some code to reproduce. The error seems to be caused by calling a separate function in a parent class that returns a reference to an appscript object - commenting the last line of setUp and uncommenting the 2 lines above it lead to working code. That's an acceptable workaround, but I'm very curious what is causing the issue ... does application object get cleaned up prematurely?
Traceback (most recent call last): File "test_syslog.py", line 78, in <module> testClass.testMe() File "test_syslog.py", line 74, in testMe self.testApp.menu_bars[0].menus["File"].menu_items["Show Properties"].click() File "build/bdist.macosx-10.6-universal/egg/appscript/reference.py", line 463, in __call__ File "build/bdist.macosx-10.6-universal/egg/aem/__init__.py", line 192, in event File "build/bdist.macosx-10.6-universal/egg/aem/aemsend.py", line 57, in __init__ File "build/bdist.macosx-10.6-universal/egg/appscript/reference.py", line 275, in pack File "build/bdist.macosx-10.6-universal/egg/aem/aemcodecs.py", line 313, in pack File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 118, in AEM_packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 177, in _packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 534, in AEM_packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 118, in AEM_packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 177, in _packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 534, in AEM_packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 118, in AEM_packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 177, in _packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 534, in AEM_packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 118, in AEM_packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 176, in _packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 304, in _packkey File "build/bdist.macosx-10.6-universal/egg/appscript/reference.py", line 275, in pack File "build/bdist.macosx-10.6-universal/egg/aem/aemcodecs.py", line 325, in pack File "build/bdist.macosx-10.6-universal/egg/aem/aemcodecs.py", line 290, in packunknown TypeError: Can't pack data into an AEDesc (unsupported type): <__main__.Test instance at 0x1007a5cb0> import appscript class SuperTest(): def getProcessHandle(procName="TextEdit"): sysEvents = appscript.app("System Events") testApp = sysEvents.application_processes[procName] return testApp class Test(SuperTest): def setUp(self): application = appscript.app("TextEdit") application.activate() #sysEvents = appscript.app("System Events") #self.testApp = sysEvents.application_processes["TextEdit"] self.testApp = self.getProcessHandle() def testMe(self): self.testApp.menu_bars[0].menus["File"].menu_items["Show Properties"].click() testClass = Test() testClass.setUp() testClass.testMe() Thanks, Ben P _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG