[Twisted-Python] disturbing trial exceptions
Hi, since my last svn update of twisted, some strange errors started popping up when testing my package with trial. I've tracked down the exact revision with which the errors started to appear:
------------------------------------------------------------------------ r21907 | therve | 2007-11-20 20:32:56 +0100 (Tue, 20 Nov 2007) | 9 lines
Merge test-plugins-not-shared-942
Author: therve Reviewers: exarkun, jml, glyph Fixes #942
Fix twisted.test.test_plugin so that it doesn't use twisted.plugins anymore, but create temporary plugins beneath _trial_temp instead.
------------------------------------------------------------------------
The first exception is: exceptions.AttributeError: 'module' object has no attribute 'running' As the errors are from seemingly dynamically generated code (at least I could only find .pyc files, no source), I didn't try to investigate further. After the errors, all tests are correctly run through, so it's just plain disturbing. Here's the full error output:
Traceback (most recent call last): File "/home/markus/projects/twisted/twisted/python/usage.py", line 241, in parseOptions self.postOptions() File "/home/markus/projects/twisted/twisted/scripts/trial.py", line 292, in postOptions self['reporter'] = self._loadReporterByName(self['reporter']) File "/home/markus/projects/twisted/twisted/scripts/trial.py", line 278, in _loadReporterByName for p in plugin.getPlugins(itrial.IReporter): File "/home/markus/projects/twisted/twisted/plugin.py", line 200, in getPlugins allDropins = getCache(package) --- <exception caught here> --- File "/home/markus/projects/twisted/twisted/plugin.py", line 165, in getCache provider = pluginModule.load() File "/home/markus/projects/twisted/twisted/python/modules.py", line 380, in load return self.pathEntry.pythonPath.moduleLoader(self.name) File "/home/markus/projects/twisted/twisted/python/modules.py", line 618, in moduleLoader return self._moduleLoader(modname) File "/home/markus/projects/twisted/twisted/python/reflect.py", line 361, in namedAny topLevelPackage = __import__(trialname) File "/home/markus/projects/twisted/twisted/plugins/notestplugin.py", line 18, in ?
exceptions.AttributeError: 'module' object has no attribute 'running' Traceback (most recent call last): File "/home/markus/projects/twisted/twisted/python/usage.py", line 241, in parseOptions self.postOptions() File "/home/markus/projects/twisted/twisted/scripts/trial.py", line 292, in postOptions self['reporter'] = self._loadReporterByName(self['reporter']) File "/home/markus/projects/twisted/twisted/scripts/trial.py", line 278, in _loadReporterByName for p in plugin.getPlugins(itrial.IReporter): File "/home/markus/projects/twisted/twisted/plugin.py", line 200, in getPlugins allDropins = getCache(package) --- <exception caught here> --- File "/home/markus/projects/twisted/twisted/plugin.py", line 165, in getCache provider = pluginModule.load() File "/home/markus/projects/twisted/twisted/python/modules.py", line 380, in load return self.pathEntry.pythonPath.moduleLoader(self.name) File "/home/markus/projects/twisted/twisted/python/modules.py", line 618, in moduleLoader return self._moduleLoader(modname) File "/home/markus/projects/twisted/twisted/python/reflect.py", line 361, in namedAny topLevelPackage = __import__(trialname) File "/home/markus/projects/twisted/twisted/plugins/testplugin.py", line 12, in ?
exceptions.ImportError: cannot import name ITestPlugin
Help appreciated. Regards Markus
Le Friday 14 December 2007 13:00:26 Markus Schiltknecht, vous avez écrit :
Hi,
since my last svn update of twisted, some strange errors started popping up when testing my package with trial. I've tracked down the exact
revision with which the errors started to appear:
------------------------------------------------------------------------ r21907 | therve | 2007-11-20 20:32:56 +0100 (Tue, 20 Nov 2007) | 9 lines
Merge test-plugins-not-shared-942
Author: therve Reviewers: exarkun, jml, glyph Fixes #942
Fix twisted.test.test_plugin so that it doesn't use twisted.plugins anymore, but create temporary plugins beneath _trial_temp instead.
------------------------------------------------------------------------
The first exception is: exceptions.AttributeError: 'module' object has no attribute 'running'
As the errors are from seemingly dynamically generated code (at least I could only find .pyc files, no source), I didn't try to investigate further.
You have to remove the pyc files in the plugins (and probably the dropin.cache file too), because the source files have been removed by this revision. The responsability for this problem is not clear yet, but in this case it was for a good reason :). -- Thomas
On Dec 14, 2007 7:00 AM, Markus Schiltknecht
As the errors are from seemingly dynamically generated code (at least I could only find .pyc files, no source), I didn't try to investigate further.
Actually, those aren't dynamically generated. Those are old .pyc files (which were generated from .py files that *used* to exist), and they should be removed. Your problems will probably go away after that. -- Christopher Armstrong International Man of Twistery http://radix.twistedmatrix.com/ http://twistedmatrix.com/ http://canonical.com/
Hi Christopher, Christopher Armstrong wrote:
Actually, those aren't dynamically generated. Those are old .pyc files (which were generated from .py files that *used* to exist), and they should be removed. Your problems will probably go away after that.
Hehe, obviously I'm expecting too many bells and whistles in twisted. Dynamically generated python code, tz tz... Thanks for the explanation, also to Thomas, solved my problem. Regards Markus
participants (3)
-
Christopher Armstrong
-
Markus Schiltknecht
-
Thomas Hervé