[issue34495] excess_args asserts if args == nullptr

2018-08-29 Thread Benjamin Peterson
Change by Benjamin Peterson : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue34495] excess_args asserts if args == nullptr

2018-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The third argument of tp_new() should be a dict or NULL. -- ___ Python tracker ___ ___ Python-b

[issue34495] excess_args asserts if args == nullptr

2018-08-29 Thread Tatyana
Tatyana added the comment: So, user has to do PyObject *empty_args = PyTuple_New(0); inst = PyBaseObject_Type.tp_new(type_obj, empty_args, Py_None); Py_DECREF(empty_args); when type_obj doesn't require arguments for constructing? -- _

[issue34495] excess_args asserts if args == nullptr

2018-08-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: object_new and object_init should not be called with args == NULL. This looks like a bug in the user code. Even without assert(PyTuple_Check(args)) in PyTuple_GET_SIZE it dereferences the NULL pointer if args == NULL. Unless there is a code in CPython imp

[issue34495] excess_args asserts if args == nullptr

2018-08-24 Thread Tatyana
New submission from Tatyana : Since version 3.7 PyTuple_GET_SIZE performs assert(PyTuple_Check(args)); Due to this change, object_new and object_init cannot be called with args == nullptr. Such behavior breaks existing user's code, particularly a code generated with Swig. -- componen