Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gramatically incorrect error message for some calls with wrong number of arguments #78308

Closed
pppery mannequin opened this issue Jul 16, 2018 · 10 comments
Closed

Gramatically incorrect error message for some calls with wrong number of arguments #78308

pppery mannequin opened this issue Jul 16, 2018 · 10 comments
Labels
3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@pppery
Copy link
Mannequin

pppery mannequin commented Jul 16, 2018

BPO 34127
Nosy @rhettinger, @terryjreedy, @pppery, @tirkarthi, @bansalanjali2512
PRs
  • bpo-34127: Fix grammar in error message with respect to argument count #8395
  • 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 2018-07-22.20:14:02.863>
    created_at = <Date 2018-07-16.18:38:33.829>
    labels = ['interpreter-core', 'type-feature', '3.8']
    title = 'Gramatically incorrect error message for some calls with wrong number of arguments'
    updated_at = <Date 2018-07-23.05:55:57.520>
    user = 'https://github.com/pppery'

    bugs.python.org fields:

    activity = <Date 2018-07-23.05:55:57.520>
    actor = 'xtreak'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-07-22.20:14:02.863>
    closer = 'rhettinger'
    components = ['Interpreter Core']
    creation = <Date 2018-07-16.18:38:33.829>
    creator = 'ppperry'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34127
    keywords = ['patch']
    message_count = 10.0
    messages = ['321752', '322048', '322052', '322092', '322126', '322146', '322155', '322165', '322166', '322178']
    nosy_count = 5.0
    nosy_names = ['rhettinger', 'terry.reedy', 'ppperry', 'xtreak', 'bansalanjali']
    pr_nums = ['8395']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue34127'
    versions = ['Python 3.8']

    @pppery
    Copy link
    Mannequin Author

    pppery mannequin commented Jul 16, 2018

    `{}.get()`
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: get expected at least 1 arguments, got 0

    Shouldn't that be "TypeError: get expected at least 1 argument, got 0" instead?

    @pppery pppery mannequin added 3.7 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Jul 16, 2018
    @terryjreedy
    Copy link
    Member

    Yes. 0 things, (1/2 thing), 1 thing, (3/2 things), 2... things is the bugaboo of formatting sentences with a number field. Raymond, will we accept a patch for this?

    @terryjreedy terryjreedy added the 3.8 only security fixes label Jul 21, 2018
    @pppery
    Copy link
    Mannequin Author

    pppery mannequin commented Jul 21, 2018

    Another test case:

    > classmethod()

    Traceback (most recent call last):
      File "<pyshell#25>", line 2, in check
    TypeError: classmethod expected 1 arguments, got 0

    @pppery pppery mannequin changed the title Gramatically incorrect error message for some descriptor calls with wrong number of arguments Gramatically incorrect error message for some calls with wrong number of arguments Jul 21, 2018
    @bansalanjali2512
    Copy link
    Mannequin

    bansalanjali2512 mannequin commented Jul 21, 2018

    Is this still active? I want to fix the patch.

    @rhettinger
    Copy link
    Contributor

    Raymond, will we accept a patch for this?

    If the patch is simple and minimal, then this seems like a minor but nice little improvement.

    @tirkarthi
    Copy link
    Member

    I have added a simple patch based on the changes by https://bugs.python.org/issue29951. The C code related error messages doesn't seem to have been covered by tests and I have added some tests. I have limited knowledge of C and this is my first C patch so code comments if any will be helpful.

    Thanks

    @terryjreedy
    Copy link
    Member

    We don't normally backport an exception message change unless its content, as opposed to style, is erroneous.

    @terryjreedy terryjreedy added type-feature A feature request or enhancement and removed 3.7 (EOL) end of life labels Jul 22, 2018
    @rhettinger
    Copy link
    Contributor

    New changeset 1426daa by Raymond Hettinger (Xtreak) in branch 'master':
    bpo-34127: Fix grammar in error message with respect to argument count (GH-8395)
    1426daa

    @rhettinger
    Copy link
    Contributor

    Nice work. Thanks for the patch.

    @tirkarthi
    Copy link
    Member

    Thanks, I have created https://bugs.python.org/issue34193 to address PR comments and further enhancements in getargs.c

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants