[New-bugs-announce] [issue26427] w* format in PyArg_ParseTupleAndKeywords for optional argument

Victor Halperin report at bugs.python.org
Wed Feb 24 09:46:26 EST 2016


New submission from Victor Halperin:

Two functions read the format string in Python/getargs.c: convertitem() for present arguments and skipitem() for missing ones. They must agree on the format; in fact, a comment to this effect is written right above convertitem(). Nevertheless, skipitem() only allows '*' modifier with 's' and 'z' formats, unlike convertitem(), that correctly processes 'w*'. As a result, 'w*' works if an array arguments is supplied, and fails if it is omitted. Suggested fix: add c == 'w' comparison to the line with *format == '*' in skipitem().

----------
components: Interpreter Core
files: getargs.c
messages: 260807
nosy: VHalperin
priority: normal
severity: normal
status: open
title: w* format in PyArg_ParseTupleAndKeywords for optional argument
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file42021/getargs.c

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26427>
_______________________________________


More information about the New-bugs-announce mailing list