This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Gramatically incorrect error message for some calls with wrong number of arguments
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: bansalanjali, ppperry, rhettinger, terry.reedy, xtreak
Priority: normal Keywords: patch

Created on 2018-07-16 18:38 by ppperry, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8395 merged xtreak, 2018-07-22 15:01
Messages (10)
msg321752 - (view) Author: (ppperry) Date: 2018-07-16 18:38
`{}.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?
msg322048 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-07-21 00:32
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?
msg322052 - (view) Author: (ppperry) Date: 2018-07-21 00:49
Another test case: 

>> classmethod()

Traceback (most recent call last):
  File "<pyshell#25>", line 2, in check
TypeError: classmethod expected 1 arguments, got 0
msg322092 - (view) Author: Anjali Bansal (bansalanjali) * Date: 2018-07-21 09:43
Is this still active? I want to fix the patch.
msg322126 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2018-07-22 00:54
> 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.
msg322146 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2018-07-22 15:05
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
msg322155 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-07-22 18:20
We don't normally backport an exception message change unless its content, as opposed to style, is erroneous.
msg322165 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2018-07-22 20:13
New changeset 1426daa4fe47d8f8be0d416f7cba7adae1d5839f by Raymond Hettinger (Xtreak) in branch 'master':
bpo-34127: Fix grammar in error message with respect to argument count (GH-8395)
https://github.com/python/cpython/commit/1426daa4fe47d8f8be0d416f7cba7adae1d5839f
msg322166 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2018-07-22 20:14
Nice work.  Thanks for the patch.
msg322178 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2018-07-23 05:55
Thanks, I have created https://bugs.python.org/issue34193 to address PR comments and further enhancements in getargs.c
History
Date User Action Args
2022-04-11 14:59:03adminsetgithub: 78308
2018-07-23 05:55:57xtreaksetmessages: + msg322178
2018-07-22 20:14:02rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg322166

stage: patch review -> resolved
2018-07-22 20:13:29rhettingersetmessages: + msg322165
2018-07-22 18:20:42terry.reedysettype: enhancement
messages: + msg322155
versions: - Python 3.6, Python 3.7
2018-07-22 15:05:05xtreaksetmessages: + msg322146
2018-07-22 15:01:11xtreaksetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request7922
2018-07-22 02:33:42xtreaksetnosy: + xtreak
2018-07-22 00:54:20rhettingersetmessages: + msg322126
2018-07-21 09:43:05bansalanjalisetnosy: + bansalanjali
messages: + msg322092
2018-07-21 00:49:29ppperrysetmessages: + msg322052
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
2018-07-21 00:32:44terry.reedysetversions: + Python 3.8
nosy: + rhettinger, terry.reedy

messages: + msg322048

stage: needs patch
2018-07-16 18:38:33ppperrycreate