Message282778
The new _asyncio module of Python 3.6 uses the _PyObject_CallMethodId() function to call functions. This function has a weird behaviour when using the format string "O": if the object is a tuple, the tuple is unpacked.
_PyObject_CallMethodId(obj, &PyId_meth, "O", tuple, NULL) calls obj.meth(*tuple) instead of obj.meth(tuple).
I only found one function which may have the bug: task_call_step(). But it seems like this function cannot be called with a tuple as "arg", only with an exception object.
But just in case, I would suggest to replace:
_PyObject_CallMethodId(obj, nameid, "O", arg);
with
_PyObject_CallMethodIdObjArgs(obj, nameid, arg, NULL);
Note: _PyObject_CallMethodId() is called with a NULL terminal in the argument list, but the NULL is useless. A terminator is only required by _PyObject_CallMethodIdObjArgs(). Yeah, Python has a wide choice of functions to call a callable object, with funny APIs... And I'm adding new ones to Python 3.7 ;-) |
|
Date |
User |
Action |
Args |
2016-12-09 13:38:13 | vstinner | set | recipients:
+ vstinner, gvanrossum, yselivanov |
2016-12-09 13:38:13 | vstinner | set | messageid: <1481290693.49.0.157975678284.issue28920@psf.upfronthosting.co.za> |
2016-12-09 13:38:13 | vstinner | link | issue28920 messages |
2016-12-09 13:38:12 | vstinner | create | |
|