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 <rep...@bugs.python.org> <http://bugs.python.org/issue26427> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com