[issue29867] Add asserts in PyXXX_GET_SIZE macros

2017-04-21 Thread STINNER Victor
STINNER Victor added the comment: I merged your PR. We are at the begining of the 3.7 cycle. Applications can be fixed before 3.7. In the worst case, we can revert the change. I like this enhancement, it should help to catch bugs ;-) -- resolution: -> fixed stage: patch review -> res

[issue29867] Add asserts in PyXXX_GET_SIZE macros

2017-04-21 Thread STINNER Victor
STINNER Victor added the comment: New changeset 1a5856bf9295fa73995898d576e0bedf016aee1f by Victor Stinner (Serhiy Storchaka) in branch 'master': bpo-29867: Add asserts in PyTuple_GET_SIZE, PyList_GET_SIZE and PySet_GET_SIZE. (#751) https://github.com/python/cpython/commit/1a5856bf9295fa739958

[issue29867] Add asserts in PyXXX_GET_SIZE macros

2017-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It would be enough to compile them. New macros produce compiler error when used as lvalue. But I afraid it will take too much time on my netbook. -- ___ Python tracker

[issue29867] Add asserts in PyXXX_GET_SIZE macros

2017-03-21 Thread STINNER Victor
STINNER Victor added the comment: We should test to run popular C extensions like numpy, PyQt, cython, pillow, etc. with a patched Python to see if it's common to use a "GET" macro to "set" a size. Maybe test also Django see it probably uses many C extensions. I don't ask to test all these mod

[issue29867] Add asserts in PyXXX_GET_SIZE macros

2017-03-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +665 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue29867] Add asserts in PyXXX_GET_SIZE macros

2017-03-21 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch adds asserts for checking the type in macros PyTuple_GET_SIZE, PyList_GET_SIZE and PySet_GET_SIZE. This can help to find the misuse of these macros. Asserts already are used in macros PyBytes_GET_SIZE, PyByteArray_GET_SIZE, PyUnicode_GET_SIZ