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

Not accurate error message for exact number of positional arguments #80463

Closed
serhiy-storchaka opened this issue Mar 13, 2019 · 2 comments
Closed
Labels
3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 36282
Nosy @serhiy-storchaka
PRs
  • bpo-36282: Improved error message for too much positional arguments. #12310
  • 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 2019-03-14.07:28:16.535>
    created_at = <Date 2019-03-13.20:44:52.516>
    labels = ['interpreter-core', 'type-feature', '3.8']
    title = 'Not accurate error message for exact number of positional arguments'
    updated_at = <Date 2019-03-14.07:28:16.535>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2019-03-14.07:28:16.535>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-03-14.07:28:16.535>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core']
    creation = <Date 2019-03-13.20:44:52.516>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36282
    keywords = ['patch']
    message_count = 2.0
    messages = ['337874', '337876']
    nosy_count = 1.0
    nosy_names = ['serhiy.storchaka']
    pr_nums = ['12310']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue36282'
    versions = ['Python 3.8']

    @serhiy-storchaka
    Copy link
    Member Author

    Due to minor error, the error message for too many positional arguments is not accurate if the function uses Argument Clinic.

    For example:

    >>> int.from_bytes(b'a', 'little', False)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: from_bytes() takes at most 2 positional arguments (3 given)

    This is correct, but not accurate, because from_bytes() takes *exactly* 2 positional arguments.

    @serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Mar 13, 2019
    @serhiy-storchaka
    Copy link
    Member Author

    New changeset f2f55e7 by Serhiy Storchaka in branch 'master':
    bpo-36282: Improved error message for too much positional arguments. (GH-12310)
    f2f55e7

    @serhiy-storchaka serhiy-storchaka added type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error labels Mar 14, 2019
    @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

    1 participant