From: arcege at shore.net (Michael P. Reilly)
Date: Fri, 30 Apr 1999 20:36:37 GMT
Subject: Extension Doc bug
References: <WtnU2.298$7j4.117754@news.shore.net> <14120.52559.376120.364972@weyr.cnri.reston.va.us> <odoW2.207$9L5.69331@news.shore.net>
Message-ID: <pvoW2.209$9L5.70113@news.shore.net>
Content-Length: 1316
X-UID: 1526                                                  

Michael P. Reilly <arcege at shore.net> wrote:
: Fred L. Drake <fdrake at cnri.reston.va.us> wrote:

: : Michael P. Reilly writes:
: :  > I just spent the morning trying to find a very obscure bug related to
: :  > the passing keyword arguments to a builtin method/function.

: : Michael,
: :   You didn't post your original code that exhibited the bug, so I
: : can't be sure of my conclusions.  If you can send source for enough of 
: : your extension module that someone can compile it, that would be
: : helpful.
: :   My first inclination, however, is that you passed in illegal
: : arguments to PyArg_ParseTupleAndKeywords().  Passing NULL for the
: : keywords dictionary is allowed; I've been looking at the
: : implementation and don't see a way for that to be a problem (but I
: : might have missed something).

Some additional information: the exc_value that I got was 'bad argument
to internal function' which is set by PyErr_BadInternalCall().  The
only location inside the calling routines for this exception to be
raised is inside ceval.c:call_function() (true for 1.5.1 and 1.5.2):

        if (kw != NULL && !PyDict_Check(kw)) {
                PyErr_BadInternalCall();
                return NULL;
        }

Hopefully, I will be able to recreate and debug this further this
weekend.

  -Arcege





