The failure is a combination of two bugs in Twisted.
The first is that Twisted's result adapter object passes a thing that looks like the result of sys.exc_info(), but isn't quite the same. Zope recently has come to rely on more features of the third value of that tuple; features that Trial doesn't provide.
At some point, Zope raises:
AttributeError: "'_Frame' object has no attribute 'f_locals'"
The failure is a combination of two bugs in Twisted.
The first is that Twisted's result adapter object passes a thing that looks like the result of sys.exc_info(), but isn't quite the same. Zope recently has come to rely on more features of the third value of that tuple; features that Trial doesn't provide.
At some point, Zope raises:
AttributeError: "'_Frame' object has no attribute 'f_locals'"
Here's the pdb stack:
/home/jml/ src/launchpad/ ec2test- karmic-bug-424197/bin/test(219)?() run(defaults) jml/repos/ lp-sourcedeps/ eggs/zope. testing- 3.8.1-py2. 4.egg/zope/ testing/ testrunner/ __init_ _.py(32) run() defaults, args, script_ parts=script_ parts) jml/repos/ lp-sourcedeps/ eggs/zope. testing- 3.8.1-py2. 4.egg/zope/ testing/ testrunner/ __init_ _.py(45) run_internal( ) jml/repos/ lp-sourcedeps/ eggs/zope. testing- 3.8.1-py2. 4.egg/zope/ testing/ testrunner/ runner. py(136) run() jml/repos/ lp-sourcedeps/ eggs/zope. testing- 3.8.1-py2. 4.egg/zope/ testing/ testrunner/ runner. py(216) run_tests( ) jml/repos/ lp-sourcedeps/ eggs/zope. testing- 3.8.1-py2. 4.egg/zope/ testing/ testrunner/ runner. py(374) run_layer( ) jml/repos/ lp-sourcedeps/ eggs/zope. testing- 3.8.1-py2. 4.egg/zope/ testing/ testrunner/ runner. py(306) run_tests( ) jml/src/ launchpad/ ec2test- karmic-bug-424197/lib/twisted/ trial/unittest. py(632) __call_ _() jml/src/ launchpad/ ec2test- karmic-bug-424197/lib/twisted/ trial/unittest. py(956) run() (None, result) jml/src/ launchpad/ ec2test- karmic-bug-424197/lib/twisted/ trial/unittest. py(659) deferSetUp( ) (result, )) jml/src/ launchpad/ package- permission- love/lib/ twisted/ internet/ defer.py( 186)addCallback s() cks() jml/src/ launchpad/ package- permission- love/lib/ twisted/ internet/ defer.py( 328)_runCallbac ks() self.result, *args, **kw) jml/src/ launchpad/ ec2test- karmic-bug-424197/lib/twisted/ trial/unittest. py(675) deferTestMethod () (result, )) jml/src/ launchpad/ package- permission- love/lib/ twisted/ internet/ defer.py( 186)addCallback s() cks() jml/src/ launchpad/ package- permission- love/lib/ twisted/ internet/ defer.py( 328)_runCallbac ks() self.result, *args, **kw) jml/src/ launchpad/ ec2test- karmic-bug-424197/lib/twisted/ trial/unittest. py(694) _ebDeferTestMet hod() addFailure( self, f) jml/src/ launchpad/ ec2test- karmic-bug-424197/lib/twisted/ trial/unittest. py(1162) addFailure( ) addFailure( test, self._exc_ info(fail) ) repos/lp- sourcedeps/ eggs/zope. testing- 3.8.1-py2. 4.egg/zope/ testing/ testrunner/ runner. py(714) addFailure( ) jml/repos/ lp-sourcedeps/ eggs/zope. testing- 3.8.1-py2. 4.egg/zope/ testing/ testrunner/ formatter. py(319) test_failure( ) traceback( "Failure in test %s" % test, exc_info) jml/repos/ lp-sourcedeps/ eggs/zope. testing- 3.8.1-py2. 4.egg/zope/ testing/ testrunner/ formatter. py(570) print_traceback () traceback( exc_info) jml/repos/ lp-sourcedeps/ eggs/zope. testing- 3.8.1-py2. 4.egg/zope/ testing/ testrunner/ formatter. py(343) format_ traceback( ) traceback. format_ exception( *exc_info) ) jml/repos/ lp-sourcedeps/ eggs/zope. testing- 3.8.1-py2. 4.egg/zope/ testing/ testrunner/ tb_format. py(30)format_ exception( ) tion(t, v, tb) jml/repos/ lp-sourcedeps/ eggs/zope. exceptions- 3.5.2-py2. 4.egg/zope/ exceptions/ exceptionformat ter.py( 174)formatExcep tion() f_locals. get('__ exception_ formatter_ _'):
-> result = testrunner.
/home/
-> failed = run_internal(
/home/
-> runner.run()
/home/
-> self.run_tests()
/home/
-> setup_layers, self.failures, self.errors)
/home/
-> return run_tests(options, tests, layer_name, failures, errors)
/home/
-> test(result)
/home/
-> return self.run(*args, **kwargs)
/home/
-> d = self.deferSetUp
/home/
-> errbackArgs=
/home/
-> self._runCallba
/home/
-> self.result = callback(
/home/
-> errbackArgs=
/home/
-> self._runCallba
/home/
-> self.result = callback(
/home/
-> result.
/home/
-> self.original.
> /home/jml/
-> exc_info)
/home/
-> self.print_
/home/
-> tb = self.format_
/home/
-> tb = "".join(
/home/
-> return fmt.formatExcep
/home/
-> if tb.tb_frame.
The other bug is the linked bug, Trial swallows any errors that occur in the test result object (which is where the error is occurring).
For Launchpad's purposes, we need to improve Trial's test result adapter to be good enough to fake sys.exc_info() for Zope.