Skip to content

Extension function optional argument specification | causes RuntimeError #48970

Closed

Description

@pearu
mannequin
BPO 4720
Nosy @benjaminp
Files
  • barmodule.c: Extension module demonstrating the bug
  • 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 = None
    closed_at = <Date 2008-12-22.20:53:19.841>
    created_at = <Date 2008-12-22.12:49:22.682>
    labels = ['extension-modules', 'type-crash']
    title = 'Extension function optional argument specification | causes RuntimeError'
    updated_at = <Date 2008-12-22.20:53:19.839>
    user = 'https://bugs.python.org/pearu'

    bugs.python.org fields:

    activity = <Date 2008-12-22.20:53:19.839>
    actor = 'benjamin.peterson'
    assignee = 'none'
    closed = True
    closed_date = <Date 2008-12-22.20:53:19.841>
    closer = 'benjamin.peterson'
    components = ['Extension Modules']
    creation = <Date 2008-12-22.12:49:22.682>
    creator = 'pearu'
    dependencies = []
    files = ['12424']
    hgrepos = []
    issue_num = 4720
    keywords = []
    message_count = 2.0
    messages = ['78179', '78209']
    nosy_count = 2.0
    nosy_names = ['pearu', 'benjamin.peterson']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue4720'
    versions = ['Python 2.6']

    Activity

    1. pearu commented on Dec 22, 2008

      pearumannequin
      MannequinAuthor

      Calling the following extension function

      static PyObject *
      baz(PyObject *self, PyObject *args, PyObject *keywds)
      {
        static char *kwlist[] = {NULL};
        if (!PyArg_ParseTupleAndKeywords(args,keywds,"|:bar.baz", kwlist))
          return NULL;
        return Py_BuildValue("");
      }

      raises

      RuntimeError: more argument specifiers than keyword list entries
      (remaining format:'|:bar.baz')

      in Python 2.6 but it used to work with earlier versions of Python.

      This bug breaks all f2py generated extension modules when using Python 2.6.

    2. added
      extension-modules
      type-crash
      on Dec 22, 2008
    3. benjaminp commented on Dec 22, 2008

      @benjaminp
      Contributor

      Thanks for the report! Fixed in r67905.

    4. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      extension-modulestype-crash

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions