In article <[EMAIL PROTECTED]>,
 Paul Rubin <http://[EMAIL PROTECTED]> wrote:

> Steve Holden <[EMAIL PROTECTED]> writes:
> > > Does no one care about an internal error in the regular expression
> > > engine?
> > >
> > Not one that requires parsing a 100 kilobyte re that should be
> > replaced by something more sensible, no.
> 
> If the internal error means the re engine bumped into some internal
> limit and gracefully raised an exception, then fine.  If "internal
> error" means the re engine unexpectedly got into some inconsistent
> internal state, then threw up its hands and barfed after discovering
> the error sometime later, that's bad.  Does nobody care which it is?

The nice thing about an open source project is that if nobody else gets 
excited about some particular issue which is bothering you, you can take a 
look yourself.

(from Python-2.3.4/Modules/_sre.c):

static void
pattern_error(int status)
{
    switch (status) {
    case SRE_ERROR_RECURSION_LIMIT:
        PyErr_SetString(
            PyExc_RuntimeError,
            "maximum recursion limit exceeded"
            );
        break;
    case SRE_ERROR_MEMORY:
        PyErr_NoMemory();
        break;
    default:
        /* other error codes indicate compiler/engine bugs */
        PyErr_SetString(
            PyExc_RuntimeError,
            "internal error in regular expression engine"
            );
    }
}

I suppose one man's graceful exit is another man's barf.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to