[New-bugs-announce] [issue28981] distutils/check.py overzealous catch block hides errors

Matt Bogosian report at bugs.python.org
Thu Dec 15 13:08:08 EST 2016


New submission from Matt Bogosian:

>From (e.g) https://github.com/python/cpython/blob/2.7/Lib/distutils/command/check.py#L145:

{{{
        try:
            parser.parse(data, document)
        except AttributeError as e:  # <- this could happen anywhere inside parser.parse
            reporter.messages.append(
(-1, 'Could not finish the parsing: %s.' % e, '', {}))
}}}

Without a stack trace, diagnosing problems like #23063 becomes unnecessarily difficult. See also:

* https://sourceforge.net/p/docutils/bugs/270/
* https://sourceforge.net/p/docutils/bugs/302/

I'd offer a patch, but I'm not sure what is meant to be signaled by the `AttributeError`. (Could `parser.parse` not exist? Is it something else?)

----------
components: Distutils
messages: 283338
nosy: dstufft, eric.araujo, posita
priority: normal
severity: normal
status: open
title: distutils/check.py overzealous catch block hides errors
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28981>
_______________________________________


More information about the New-bugs-announce mailing list