Victor Stinner

Results 709 comments of Victor Stinner

Python 3.10 change (issue #85115): > The PY_SSIZE_T_CLEAN macro must now be defined to use PyArg_ParseTuple() and Py_BuildValue() formats which use #: es#, et#, s#, u#, y#, z#, U# and...

@encukou: You may be interested by this tricky issue :-) I don't know its status in Python 3.12.

If recent versions of Python are fine, can we just close the issue?

> It's a known and well-documented behavior of the tar module Would it possible to disable this behaviour by default, and only enable ti explicitly? The tar command line program...

I looked at the x86-64 machine code of test_py_clear() built by gcc -O3. I don't see any ``PyObject**`` type anymore, GCC works directly on pointers (``PyObject*``): inefficient was removed by...

I completed test_py_clear() to test calling Py_CLEAR() with a side effect: test based on https://github.com/python/cpython/issues/98724#issuecomment-1292591490 idea.

> I have some suggestion for the test: It should crash with the old Py_CLEAR version so you do not get any regressions. It does crash with the old Py_CLEAR()...

cc @serhiy-storchaka: there is now a unit test which shows that the old macro had a bug.

> Py_SETREF? I don't understand your comment. This PR fix a bug in Py_CLEAR(). Can you please elaborate?

> I think all macros should be changed so they only reference their arguments once. This avoids the whole issue with side effects applied multiple times. That's one of the...