configuration error
hi all, We are stuck with a configuration error in porting zope2 to python2.5. Can anybody help us in fixing configuration error in the module Zope2. The full log of error message is given below. Running tests at level 1 /home/zope/ztrunk25/lib/python/ZPublisher/HTTPResponse.py:19: RuntimeWarning: Python C API version mismatch for module zlib: This Python has API version 1013, module zlib has version 1012. import zlib, struct Running unit tests: Running: 6/43 (14.0%) testStringException1 (....testExceptionHook.ExceptionHookTest)/home/zope/ztrunk25/lib/python/Zope2/App/tests/testExceptionHook.py:120: DeprecationWarning: raising a string exception is deprecated raise 'unauthorized', 'x' /home/zope/ztrunk25/lib/python/Zope2/App/startup.py:182: DeprecationWarning: raising a string exception is deprecated raise 7/43 (16.3%) testStringException2 (....testExceptionHook.ExceptionHookTest)/home/zope/ztrunk25/lib/python/Zope2/App/tests/testExceptionHook.py:125: DeprecationWarning: raising a string exception is deprecated raise 'redirect', 'x' 41/43 (95.3%) test_behavior (...artup.tests.test_warnfilter.TestWarnFilter) Error in test test_behavior (Zope2.Startup.tests.test_warnfilter.TestWarnFilter) Traceback (most recent call last): File "/home/zope/usr/lib/python2.5/unittest.py", line 260, in run testMethod() File "/home/zope/ztrunk25/lib/python/Zope2/Startup/tests/test_warnfilter.py", line 90, in test_behavior """) File "/home/zope/ztrunk25/lib/python/Zope2/Startup/tests/test_warnfilter.py", line 69, in load_config_text conf, handler = ZConfig.loadConfigFile(schema, sio) File "/home/zope/ztrunk25/lib/python/ZConfig/loader.py", line 41, in loadConfigFile return _get_config_loader(schema, overrides).loadFile(file, url) File "/home/zope/ztrunk25/lib/python/ZConfig/loader.py", line 75, in loadFile return self.loadResource(r) File "/home/zope/ztrunk25/lib/python/ZConfig/loader.py", line 229, in loadResource self._parse_resource(sm, resource) File "/home/zope/ztrunk25/lib/python/ZConfig/loader.py", line 280, in _parse_resource parser.parse(matcher) File "/home/zope/ztrunk25/lib/python/ZConfig/cfgparser.py", line 57, in parse section = self.end_section(section, line[2:-1]) File "/home/zope/ztrunk25/lib/python/ZConfig/cfgparser.py", line 112, in end_section self.error(e[0]) File "/home/zope/ztrunk25/lib/python/ZConfig/cfgparser.py", line 177, in error raise ZConfig.ConfigurationSyntaxError(message, self.url, self.lineno) ConfigurationSyntaxError: invalid warning category: 'Zope2.Startup.tests.test_warnfilter.TestSchemaWarning' (line 8) Ran 43 tests with 0 failures and 1 errors in 15.046 seconds. Tests with errors: test_behavior (Zope2.Startup.tests.test_warnfilter.TestWarnFilter) regards Bristow
Bristow Thankachan wrote at 2008-8-23 15:53 +0530:
We are stuck with a configuration error in porting zope2 to python2.5. Can anybody help us in fixing configuration error in the module Zope2. The full log of error message is given below. ... File "/home/zope/ztrunk25/lib/python/ZConfig/cfgparser.py", line 57, in parse section = self.end_section(section, line[2:-1]) File "/home/zope/ztrunk25/lib/python/ZConfig/cfgparser.py", line 112, in end_section self.error(e[0]) File "/home/zope/ztrunk25/lib/python/ZConfig/cfgparser.py", line 177, in error raise ZConfig.ConfigurationSyntaxError(message, self.url, self.lineno) ConfigurationSyntaxError: invalid warning category: 'Zope2.Startup.tests.test_warnfilter.TestSchemaWarning' (line 8)
I can only partially help you. Unfortunately, "ZConfig" is *VERY* bad with respect to the help it provides to understand the causes of so called "configuration problems": It turns all exceptions (configuration problems or else) into "ConfigurationError"s and in this process cuts of valuable tracebacks. Thus, we have heavy loss of information that would be helpful to analyse problems occuring during configuration but that are not configuration errors (but some import problems, or incompatibilities with the Python version as in your case). Very bad design in this respect.... When I meet such a case ("ZConfig" stupidly tells me about a "ConfigurationError" which is not (primarily) a configuration error), I temporarily change the "ZConfig" source: At places try: .... except ....: .... raise ...ConfigurationError(...) I add a "raise" line before the "raise ...ConfigurationError()". By this, I get the original exception and especially the original traceback and then can usually quickly find the original problem. In your special case, some quessing may give a faster result. It is likely that the original problem comes from "Zope2.Startup.warnfilter.warn_category". You can put a breakpoint there and then determine by single stepping the cause. An additional guess may give even a faster result. Problably the following lines are to blame: if (not isinstance(cat, types.ClassType) or not issubclass(cat, Warning)): raise ValueError("invalid warning category: %s" % `category`) Almost surely, Python made its "Warning" class a new style class such that "isinstance(cat, types.ClassType)" fails now. -- Dieter
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bristow Thankachan wrote:
hi all,
We are stuck with a configuration error in porting zope2 to python2.5. Can anybody help us in fixing configuration error in the module Zope2. The full log of error message is given below.
Running tests at level 1 /home/zope/ztrunk25/lib/python/ZPublisher/HTTPResponse.py:19: RuntimeWarning: Python C API version mismatch for module zlib: This Python has API version 1013, module zlib has version 1012. import zlib, struct Running unit tests: Running: 6/43 (14.0%) testStringException1 (....testExceptionHook.ExceptionHookTest)/home/zope/ztrunk25/lib/python/Zope2/App/tests/testExceptionHook.py:120: DeprecationWarning: raising a string exception is deprecated raise 'unauthorized', 'x' /home/zope/ztrunk25/lib/python/Zope2/App/startup.py:182: DeprecationWarning: raising a string exception is deprecated raise 7/43 (16.3%) testStringException2 (....testExceptionHook.ExceptionHookTest)/home/zope/ztrunk25/lib/python/Zope2/App/tests/testExceptionHook.py:125: DeprecationWarning: raising a string exception is deprecated raise 'redirect', 'x' 41/43 (95.3%) test_behavior (...artup.tests.test_warnfilter.TestWarnFilter)
Error in test test_behavior (Zope2.Startup.tests.test_warnfilter.TestWarnFilter) Traceback (most recent call last): File "/home/zope/usr/lib/python2.5/unittest.py", line 260, in run testMethod() File "/home/zope/ztrunk25/lib/python/Zope2/Startup/tests/test_warnfilter.py", line 90, in test_behavior """) File "/home/zope/ztrunk25/lib/python/Zope2/Startup/tests/test_warnfilter.py", line 69, in load_config_text conf, handler = ZConfig.loadConfigFile(schema, sio) File "/home/zope/ztrunk25/lib/python/ZConfig/loader.py", line 41, in loadConfigFile return _get_config_loader(schema, overrides).loadFile(file, url) File "/home/zope/ztrunk25/lib/python/ZConfig/loader.py", line 75, in loadFile return self.loadResource(r) File "/home/zope/ztrunk25/lib/python/ZConfig/loader.py", line 229, in loadResource self._parse_resource(sm, resource) File "/home/zope/ztrunk25/lib/python/ZConfig/loader.py", line 280, in _parse_resource parser.parse(matcher) File "/home/zope/ztrunk25/lib/python/ZConfig/cfgparser.py", line 57, in parse section = self.end_section(section, line[2:-1]) File "/home/zope/ztrunk25/lib/python/ZConfig/cfgparser.py", line 112, in end_section self.error(e[0]) File "/home/zope/ztrunk25/lib/python/ZConfig/cfgparser.py", line 177, in error raise ZConfig.ConfigurationSyntaxError(message, self.url, self.lineno) ConfigurationSyntaxError: invalid warning category: 'Zope2.Startup.tests.test_warnfilter.TestSchemaWarning' (line 8)
Ran 43 tests with 0 failures and 1 errors in 15.046 seconds.
Tests with errors: test_behavior (Zope2.Startup.tests.test_warnfilter.TestWarnFilter)
Because Warning shifts from being an old-style class in 2.4 to a new-style class in 2.5, the check for 'isinstance(w, types.ClassType))' won't work. Instead:: - ----------------------- %< ------------------------ - --- lib/python/Zope2/Startup/warnfilter.py (revision 90174) +++ lib/python/Zope2/Startup/warnfilter.py (working copy) @@ -35,7 +35,7 @@ cat = getattr(m, klass) except AttributeError: raise ValueError("unknown warning category: %s" % `category`) - - if (not isinstance(cat, types.ClassType) or + if (not isinstance(cat, type(Warning)) or not issubclass(cat, Warning)): raise ValueError("invalid warning category: %s" % `category`) return cat - ----------------------- %< ------------------------ I have checked this in on the trunk: http://svn.zope.org/Zope/trunk/?rev=90177&view=rev Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIsaUN+gerLs4ltQ4RAgwTAJ9roddcaighZb1IUIz8EVBeaFBe7wCfQ5h6 pvNolvSZCYczQMileZ8aDvc= =tRMb -----END PGP SIGNATURE-----
participants (3)
-
Bristow Thankachan -
Dieter Maurer -
Tres Seaver