[New-bugs-announce] [issue26902] Argument Clinic incorrectly work with custom converter and renamed parameter

Serhiy Storchaka report at bugs.python.org
Sun May 1 14:45:28 EDT 2016


New submission from Serhiy Storchaka:

Argument Clinic uses original name of Python parameter in generated code for custom (format code "O&") converter even if the parameter was renamed.

Example:

/*[clinic input]
test
    filename as path: object(converter="PyUnicode_FSConverter")
    /
[clinic start generated code]*/

Generated code:

static PyObject *
test(PyModuleDef *module, PyObject *arg)
{
    PyObject *return_value = NULL;
    PyObject *path;

    if (!PyUnicode_FSConverter(arg, &filename))
        goto exit;
    return_value = test_impl(module, path);

exit:
    return return_value;
}

----------
components: Argument Clinic
messages: 264606
nosy: larry, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Argument Clinic incorrectly work with custom converter and renamed parameter
type: behavior
versions: Python 3.5, Python 3.6

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


More information about the New-bugs-announce mailing list