r77892 - in python/trunk: Lib/test/test_sys.py Misc/NEWS Python/sysmodule.c
Author: victor.stinner Date: Sun Jan 31 23:32:15 2010 New Revision: 77892 Log: Issue #7819: Check sys.call_tracing() arguments types. py3k was already patched by issue #3661. Modified: python/trunk/Lib/test/test_sys.py python/trunk/Misc/NEWS python/trunk/Python/sysmodule.c Modified: python/trunk/Lib/test/test_sys.py ============================================================================== --- python/trunk/Lib/test/test_sys.py (original) +++ python/trunk/Lib/test/test_sys.py Sun Jan 31 23:32:15 2010 @@ -433,6 +433,10 @@ out = p.communicate()[0].strip() self.assertEqual(out, '?') + def test_call_tracing(self): + self.assertEqual(sys.call_tracing(str, (2,)), "2") + self.assertRaises(TypeError, sys.call_tracing, str, 2) + class SizeofTest(unittest.TestCase): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Jan 31 23:32:15 2010 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #7819: Check sys.call_tracing() arguments types. + - Issue #7788: Fix an interpreter crash produced by deleting a list slice with very large step value. Modified: python/trunk/Python/sysmodule.c ============================================================================== --- python/trunk/Python/sysmodule.c (original) +++ python/trunk/Python/sysmodule.c Sun Jan 31 23:32:15 2010 @@ -840,7 +840,7 @@ sys_call_tracing(PyObject *self, PyObject *args) { PyObject *func, *funcargs; - if (!PyArg_UnpackTuple(args, "call_tracing", 2, 2, &func, &funcargs)) + if (!PyArg_ParseTuple(args, "OO!:call_tracing", &func, &PyTuple_Type, &funcargs)) return NULL; return _PyEval_CallTracing(func, funcargs); }
participants (1)
-
victor.stinner