zopefoundation / zope.configuration

Extensible system for supporting various kinds of configurations
https://zopeconfiguration.readthedocs.io
Other
1 stars 6 forks source link

Exception chaining is excessive #43

Closed mgedmin closed 6 years ago

mgedmin commented 6 years ago

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):

Traceback (most recent call last):
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 817, in toargs
    args[str(name)] = field.fromUnicode(s)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/fields.py", line 85, in fromUnicode
    self._DOT_VALIDATOR.validate(to_validate)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/schema/_bootstrapfields.py", line 291, in validate
    self._validate(value)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/schema/_field.py", line 670, in _validate
    raise InvalidDottedName(value).with_field_and_value(self, value)
zope.schema.interfaces.InvalidDottedName: .systemerror.SystemErrorView

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 269, in endElementNS
    self.context.end()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 363, in end
    self.stack.pop().finish()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 471, in finish
    args = toargs(context, *self.argdata)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 820, in toargs
    None, sys.exc_info()[2])
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 817, in toargs
    args[str(name)] = field.fromUnicode(s)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/fields.py", line 85, in fromUnicode
    self._DOT_VALIDATOR.validate(to_validate)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/schema/_bootstrapfields.py", line 291, in validate
    self._validate(value)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/schema/_field.py", line 670, in _validate
    raise InvalidDottedName(value).with_field_and_value(self, value)
zope.configuration.exceptions.ConfigurationError: ('Invalid value for', 'class', '.systemerror.SystemErrorView')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 269, in endElementNS
    self.context.end()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 363, in end
    self.stack.pop().finish()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 472, in finish
    actions = self.handler(context, **args)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 398, in include
    processxmlfile(f, context)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 290, in processxmlfile
    parser.parse(src)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "/home/mg/src/cpython/Modules/pyexpat.c", line 466, in EndElement
    ("(N)", string_intern(self, name)))
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 381, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 276, in endElementNS
    None, sys.exc_info()[2])
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 269, in endElementNS
    self.context.end()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 363, in end
    self.stack.pop().finish()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 471, in finish
    args = toargs(context, *self.argdata)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 820, in toargs
    None, sys.exc_info()[2])
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 817, in toargs
    args[str(name)] = field.fromUnicode(s)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/fields.py", line 85, in fromUnicode
    self._DOT_VALIDATOR.validate(to_validate)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/schema/_bootstrapfields.py", line 291, in validate
    self._validate(value)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/schema/_field.py", line 670, in _validate
    raise InvalidDottedName(value).with_field_and_value(self, value)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/app/exception/browser/configure.zcml", line 5.2-11.8
    ConfigurationError: ('Invalid value for', 'class', '.systemerror.SystemErrorView')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 269, in endElementNS
    self.context.end()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 363, in end
    self.stack.pop().finish()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 472, in finish
    actions = self.handler(context, **args)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 398, in include
    processxmlfile(f, context)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 290, in processxmlfile
    parser.parse(src)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "/home/mg/src/cpython/Modules/pyexpat.c", line 466, in EndElement
    ("(N)", string_intern(self, name)))
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 381, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 276, in endElementNS
    None, sys.exc_info()[2])
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 269, in endElementNS
    self.context.end()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 363, in end
    self.stack.pop().finish()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 472, in finish
    actions = self.handler(context, **args)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 398, in include
    processxmlfile(f, context)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 290, in processxmlfile
    parser.parse(src)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "/home/mg/src/cpython/Modules/pyexpat.c", line 466, in EndElement
    ("(N)", string_intern(self, name)))
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 381, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 276, in endElementNS
    None, sys.exc_info()[2])
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 269, in endElementNS
    self.context.end()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 363, in end
    self.stack.pop().finish()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 471, in finish
    args = toargs(context, *self.argdata)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 820, in toargs
    None, sys.exc_info()[2])
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 817, in toargs
    args[str(name)] = field.fromUnicode(s)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/fields.py", line 85, in fromUnicode
    self._DOT_VALIDATOR.validate(to_validate)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/schema/_bootstrapfields.py", line 291, in validate
    self._validate(value)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/schema/_field.py", line 670, in _validate
    raise InvalidDottedName(value).with_field_and_value(self, value)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/app/zcmlfiles/browser.zcml", line 16.2-16.50
    ZopeXMLConfigurationError: File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/app/exception/browser/configure.zcml", line 5.2-11.8
    ConfigurationError: ('Invalid value for', 'class', '.systemerror.SystemErrorView')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 269, in endElementNS
    self.context.end()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 363, in end
    self.stack.pop().finish()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 472, in finish
    actions = self.handler(context, **args)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 398, in include
    processxmlfile(f, context)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 290, in processxmlfile
    parser.parse(src)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "/home/mg/src/cpython/Modules/pyexpat.c", line 466, in EndElement
    ("(N)", string_intern(self, name)))
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 381, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 276, in endElementNS
    None, sys.exc_info()[2])
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 269, in endElementNS
    self.context.end()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 363, in end
    self.stack.pop().finish()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 472, in finish
    actions = self.handler(context, **args)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 398, in include
    processxmlfile(f, context)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 290, in processxmlfile
    parser.parse(src)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "/home/mg/src/cpython/Modules/pyexpat.c", line 466, in EndElement
    ("(N)", string_intern(self, name)))
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 381, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 276, in endElementNS
    None, sys.exc_info()[2])
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 269, in endElementNS
    self.context.end()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 363, in end
    self.stack.pop().finish()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 472, in finish
    actions = self.handler(context, **args)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 398, in include
    processxmlfile(f, context)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 290, in processxmlfile
    parser.parse(src)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "/home/mg/src/cpython/Modules/pyexpat.c", line 466, in EndElement
    ("(N)", string_intern(self, name)))
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 381, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 276, in endElementNS
    None, sys.exc_info()[2])
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 269, in endElementNS
    self.context.end()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 363, in end
    self.stack.pop().finish()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 471, in finish
    args = toargs(context, *self.argdata)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 820, in toargs
    None, sys.exc_info()[2])
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 817, in toargs
    args[str(name)] = field.fromUnicode(s)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/fields.py", line 85, in fromUnicode
    self._DOT_VALIDATOR.validate(to_validate)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/schema/_bootstrapfields.py", line 291, in validate
    self._validate(value)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/schema/_field.py", line 670, in _validate
    raise InvalidDottedName(value).with_field_and_value(self, value)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/app/zcmlfiles/configure.zcml", line 80.2-80.33
    ZopeXMLConfigurationError: File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/app/zcmlfiles/browser.zcml", line 16.2-16.50
    ZopeXMLConfigurationError: File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/app/exception/browser/configure.zcml", line 5.2-11.8
    ConfigurationError: ('Invalid value for', 'class', '.systemerror.SystemErrorView')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/testrunner/runner.py", line 449, in run_layer
    setup_layer(options, layer, setup_layers)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/testrunner/runner.py", line 770, in setup_layer
    layer.setUp()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zodbbrowser/ftests/test_standalone.py", line 140, in setUp
    cls.server.run(cls.data_fs, '--rw')
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zodbbrowser/ftests/test_standalone.py", line 90, in run
    main(list(args), start_serving=False)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zodbbrowser/standalone.py", line 275, in main
    configure(options)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zodbbrowser/standalone.py", line 105, in configure
    context = xmlconfig.string(options.site_definition, context=context)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 513, in string
    processxmlfile(f, context)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 290, in processxmlfile
    parser.parse(src)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "/home/mg/src/cpython/Modules/pyexpat.c", line 466, in EndElement
    ("(N)", string_intern(self, name)))
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 381, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 276, in endElementNS
    None, sys.exc_info()[2])
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 269, in endElementNS
    self.context.end()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 363, in end
    self.stack.pop().finish()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 472, in finish
    actions = self.handler(context, **args)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 398, in include
    processxmlfile(f, context)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 290, in processxmlfile
    parser.parse(src)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "/home/mg/src/cpython/Modules/pyexpat.c", line 466, in EndElement
    ("(N)", string_intern(self, name)))
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 381, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 276, in endElementNS
    None, sys.exc_info()[2])
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 269, in endElementNS
    self.context.end()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 363, in end
    self.stack.pop().finish()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 472, in finish
    actions = self.handler(context, **args)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 398, in include
    processxmlfile(f, context)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 290, in processxmlfile
    parser.parse(src)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "/home/mg/src/cpython/Modules/pyexpat.c", line 466, in EndElement
    ("(N)", string_intern(self, name)))
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 381, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 276, in endElementNS
    None, sys.exc_info()[2])
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 269, in endElementNS
    self.context.end()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 363, in end
    self.stack.pop().finish()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 472, in finish
    actions = self.handler(context, **args)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 398, in include
    processxmlfile(f, context)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 290, in processxmlfile
    parser.parse(src)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "/home/mg/src/cpython/Modules/pyexpat.c", line 466, in EndElement
    ("(N)", string_intern(self, name)))
  File "/home/mg/opt/python37/lib/python3.7/xml/sax/expatreader.py", line 381, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 276, in endElementNS
    None, sys.exc_info()[2])
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/xmlconfig.py", line 269, in endElementNS
    self.context.end()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 363, in end
    self.stack.pop().finish()
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 471, in finish
    args = toargs(context, *self.argdata)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 820, in toargs
    None, sys.exc_info()[2])
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/config.py", line 817, in toargs
    args[str(name)] = field.fromUnicode(s)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/configuration/fields.py", line 85, in fromUnicode
    self._DOT_VALIDATOR.validate(to_validate)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/schema/_bootstrapfields.py", line 291, in validate
    self._validate(value)
  File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/schema/_field.py", line 670, in _validate
    raise InvalidDottedName(value).with_field_and_value(self, value)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "<string>", line 7.10-7.50
    ZopeXMLConfigurationError: File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/app/zcmlfiles/configure.zcml", line 80.2-80.33
    ZopeXMLConfigurationError: File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/app/zcmlfiles/browser.zcml", line 16.2-16.50
    ZopeXMLConfigurationError: File "/home/mg/src/zodbbrowser/.tox/py37/lib/python3.7/site-packages/zope/app/exception/browser/configure.zcml", line 5.2-11.8
    ConfigurationError: ('Invalid value for', 'class', '.systemerror.SystemErrorView')

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?

jamadden commented 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.)

mgedmin commented 6 years ago

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.)

jamadden commented 6 years ago

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.

mgedmin commented 6 years ago

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.