[Python-checkins] r63207 - in python/trunk: Misc/NEWS Modules/_bsddb.c Modules/bsddb.h

Neal Norwitz nnorwitz at gmail.com
Wed May 14 07:51:15 CEST 2008


On Tue, May 13, 2008 at 11:45 AM, jesus.cea <python-checkins at python.org> wrote:
> Author: jesus.cea
> Date: Tue May 13 20:45:46 2008
> New Revision: 63207
>
> Log:
> bsddb module updated to version 4.6.4

It would be nicer to break this change into several.  For example, the
BuildValue changes could have been a separate change from everything
else.  I'm not sure of all the pieces, but I suspect there are more
intertwined changes.

The change is too big for me to find the issues in gmail editor.
However, this line was added (actually moved):

  PyList_Append(list, item);

There should be a check that this doesn't fail.  Either check the call
with if (PyList_Append() < 0) or at the end of the loop, check
PyErr_Occurred().

In _close_transaction_cursors and DBTxn_abort_discard_internal there
were return values from calls that were not checked.  I'm not sure if
you added either of these.  One or both were the return result from
Py_BuildValue.  The value was passed to PyErr_SetError() I think.  I'm
not sure if that API can tolerate a NULL, but a Py_DECREF() followed
and that definitely can't take a NULL.

Depending on what version of Python you want to support, consider
using PyTuple_Pack().  Also, you should use METH_O and METH_NOARGS
rather than METH_VARARGS.  That will make the code faster and smaller
by removing useless calls to PyArg_ParseTuple().  You can also use
PyArg_UnpackTuple() when you only need the PyObjects out of the args.

n


More information about the Python-checkins mailing list