Closed mgedmin closed 6 years ago
I agree the tracebacks can be distracting. But the way the ConfigurationError exceptions just preserve the string or repr value of the underlying exception can also lose information. Instead of seeing the specific class of the exception (InvalidDottedName), you just tend to wind up with a bunch of context-less tuples of the arguments that don't tell you much (ConfigurationError: ('Invalid value for', 'class', '.systemerror.SystemErrorView')
Is it invalid because it's not a class? It didn't pass some constraint? It doesn't exist?) And in the end, even that's getting lost here (the final report doesn't show that at all!)
If we could have a better way to preserve all the useful information from below I wouldn't be against trimming tracebacks. Maybe each 'except' could look for a ConfigurationError
and just add its context info before reraising the same exception, and the repr for ConfigurationError
would be smart enough to show all that. (So the subclass ZopeXMLConfigurationError would go away.)
(BTW, that InvalidDottedName should be fixed with 4.2.2 of this package.)
But the way the ConfigurationError exceptions just preserve the string or repr value of the underlying exception can also lose information.
Luckily we have this feature that allows us to specify which exceptions should be propagated without being caught and wrapped! ;)
And in the end, even that's getting lost here (the final report doesn't show that at all!)
It's a copy/paste error on my part. There was one more chained exception on the end because of https://github.com/zopefoundation/zope.exceptions/issues/11 and some monkey-patching I do in my test suite. (You can see the full result I saw in all the glory at https://gist.github.com/mgedmin/78ceb2081ea2a76a40d3f8fc505a61fc)
Maybe each 'except' could look for a ConfigurationError and just add its context info before reraising the same exception, and the repr for ConfigurationError would be smart enough to show all that. (So the subclass ZopeXMLConfigurationError would go away.)
I like the way you think!
(BTW, that InvalidDottedName should be fixed with 4.2.2 of this package.)
(It is.)
There were some recent zope.schema and/or zope.configuration releases that broke ZODBBrowser (and many other things).
I believe I was responsible for those recent releases. I'm working to fix unintentional issues as fast as I can, please do file file them.
The only "intentional issue" I know of is that PythonIdentifier actually enforces that it's a PythonIdentifier. That's what caused a problem for zope.preference. If that turns out to be widespread---hopefully its not--- we can consider another release where zope.configuration.PythonIdentifier is just a deprecated alias for NativeStringLine---what it behaved like before---and recommend instead the use of zope.schema.PythonIdentifier.
I believe I was responsible for those recent releases. I'm working to fix unintentional issues as fast as I can, please do file file them.
zodbbrowser is the only zope3-based thing I still actively maintain with daily builds against latest PyPI releases, and it's gone back to green, so I think all's good now?
There are more of those bitrot problems in zopefoundation repositories, and I think it would help if we set up daily cron builds on Travis CI (in an automated way because I'm not clicking web buttons for 379 repositories!). I've a hacky dashboard at https://zope3.pov.lt/py3/travis.html for mass-checking Travis build statuses.
There were some recent zope.schema and/or zope.configuration releases that broke ZODBBrowser (and many other things). This bug is not about that. This bug is about error reporting on Python 3.
Here's the series of chained exception tracebacks I get on Python 3.6 when there's an error in a ZCML file (included from a sequence of other ZCML files):
It looks like every include adds a new exception (with full traceback) to the chain.
Can we use
raise ... from None
to disable chaining so there's only one traceback in the end?