classification
Title: w* format in PyArg_ParseTupleAndKeywords for optional argument
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: getargs.c skipitem() doesn't skip 'w*'
View: 23927
Assigned To: Nosy List: VHalperin, serhiy.storchaka
Priority: normal Keywords:

Created on 2016-02-24 14:46 by VHalperin, last changed 2016-02-24 16:49 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
getargs.c VHalperin, 2016-02-24 14:46 Suggested update for Python 2.7.11
Messages (2)
msg260807 - (view) Author: Victor Halperin (VHalperin) Date: 2016-02-24 14:46
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().
msg260819 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-02-24 16:49
This is a duplicate of issue23927.
History
Date User Action Args
2016-02-24 16:49:06serhiy.storchakasetstatus: open -> closed

superseder: getargs.c skipitem() doesn't skip 'w*'

nosy: + serhiy.storchaka
messages: + msg260819
resolution: duplicate
stage: resolved
2016-02-24 14:46:26VHalperincreate