[issue20142] Argument Clinic: Py_buffer parameters are not initialized

2014-01-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 16ff19d1d367 by Larry Hastings in branch 'default': Issue #20142: Py_buffer variables generated by Argument Clinic are now http://hg.python.org/cpython/rev/16ff19d1d367 -- nosy: +python-dev ___ Python tra

[issue20142] Argument Clinic: Py_buffer parameters are not initialized

2014-01-06 Thread Larry Hastings
Changes by Larry Hastings : -- assignee: -> larry resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ _

[issue20142] Argument Clinic: Py_buffer parameters are not initialized

2014-01-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Or perhaps we should introduce macros Py_buffer_INIT. -- ___ Python tracker ___ ___ Python-bugs-li

[issue20142] Argument Clinic: Py_buffer parameters are not initialized

2014-01-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. But is not {NULL} enough for Py_buffer initialization? -- ___ Python tracker ___ ___ Python

[issue20142] Argument Clinic: Py_buffer parameters are not initialized

2014-01-06 Thread Larry Hastings
Larry Hastings added the comment: Here's a patch, please review. You can see how Py_buffer variables are initialized in zlibmodule.c in the patch. -- Added file: http://bugs.python.org/file0/larry.clinic.py_buffer.initialization.patch.1.txt ___

[issue20142] Argument Clinic: Py_buffer parameters are not initialized

2014-01-06 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Argument Clinic doesn't initialize Py_buffer parameters. It generates cleanup code: /* Cleanup for data */ if (data.buf) PyBuffer_Release(&data); And if PyArg_ParseTuple() is failed, the buf attribute can contains arbitrary (non-NULL) data.