Argument Clinic generates invalid code for optional parameter #64395
Copy link
Copy link
Closed
Labels
buildThe build process and cross-buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
| BPO | 20196 |
|---|---|
| Nosy | @birkenfeld, @larryhastings, @serhiy-storchaka |
| Files |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = 'https://github.com/larryhastings'
closed_at = <Date 2014-01-12.16:50:39.144>
created_at = <Date 2014-01-08.21:17:00.519>
labels = ['type-bug', 'build']
title = 'Argument Clinic generates invalid code for optional parameter'
updated_at = <Date 2014-01-12.16:50:39.143>
user = 'https://github.com/serhiy-storchaka'bugs.python.org fields:
activity = <Date 2014-01-12.16:50:39.143>
actor = 'larry'
assignee = 'larry'
closed = True
closed_date = <Date 2014-01-12.16:50:39.144>
closer = 'larry'
components = ['Build']
creation = <Date 2014-01-08.21:17:00.519>
creator = 'serhiy.storchaka'
dependencies = []
files = ['33397']
hgrepos = []
issue_num = 20196
keywords = []
message_count = 6.0
messages = ['207700', '207701', '207817', '207963', '207968', '207969']
nosy_count = 4.0
nosy_names = ['georg.brandl', 'larry', 'python-dev', 'serhiy.storchaka']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'commit review'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue20196'
versions = ['Python 3.4']Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
buildThe build process and cross-buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
serhiy-storchaka commentedon Jan 8, 2014
Argument Clinic generates invalid code for optional parameter if there are no mandatory parameters except self. Example:
/*[clinic input]
zlib.Decompress.flush
Return a bytes object containing any remaining decompressed data.
[clinic start generated code]*/
Generates:
... switch (PyTuple_Size(args)) { case 0: if (!PyArg_ParseTuple(args, ":flush", )) return NULL; break; ...Note a comma in PyArg_ParseTuple.
larryhastings commentedon Jan 8, 2014
Good catch! It should be an easy fix, but I won't be able to get to it until tomorrow.
larryhastings commentedon Jan 10, 2014
Here's a fix. Works for me, let me know if it works for you.
larryhastings commentedon Jan 12, 2014
Georg, you mind reviewing this too? Six line patch. Just trying to clean my plate a little before I fix a bug for you :D
python-dev commentedon Jan 12, 2014
New changeset 250b481a0d28 by Larry Hastings in branch 'default':
Issue bpo-20196: Fixed a bug where Argument Clinic did not generate correct
http://hg.python.org/cpython/rev/250b481a0d28
larryhastings commentedon Jan 12, 2014
Easy fix. Thanks for the report!