[Python-Dev] Big trouble in CVS Python (original) (raw)

Tim Peters tim_one@email.msn.com
Sun, 13 Apr 2003 16:28:13 -0400


self.assertRaises(ValueError, range, 1e100, 1e101, 1e101) ... Given this, there's approximately no chance gc caused it. Who's been mucking with function calls (or maybe the eval loop) recently?

It appears to be a refcount error in recently-added C code that tries to generalize the builtin range() function, specifically here:

Fail: Py_XDECREF(curnum); Py_XDECREF(istep); <- here Py_XDECREF(zero);

Word to the wise: don't ever try to reuse a variable whose address is passed to PyArg_ParseTuple for anything other than holding what PyArg_ParseTuple does or doesn't store into it. You'll never get the decrefs straight (and even if you manage to at first, the next person to modify your code will break it).

only-consumed-eight-hours-this-time-ly y'rs - tim