[issue6986] _json crash on scanner/encoder initialization error

STINNER Victor report at bugs.python.org
Thu Sep 24 13:23:28 CEST 2009


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

About _json_encoder_init.patch, an alternative patch is to write
arguments references (addresses) in local variables, and only copy them
on success. Something like:
  PyObject *arg;
  if (!PyTuple_ParseArgs(..., &arg)) return NULL;
  Py_INCREF(arg);
  self->arg = arg;

I prefered to write a shorter patch.

Tell me if you prefer the alternative fix, and if you would like unit tests.

----------

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


More information about the Python-bugs-list mailing list