Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue37034

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Argument Clinic omits name of keyword-only parameter on _PyArg_BadArgument() call
Type:behaviorStage:resolved
Components:Interpreter CoreVersions:Python 3.9, Python 3.8
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: remi.lapeyre, serhiy.storchaka, vstinner
Priority:normalKeywords:patch

Created on2019-05-24 10:29 byvstinner, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 13593mergedremi.lapeyre,2019-05-27 14:13
PR 15599mergedserhiy.storchaka,2019-08-29 15:09
Messages (8)
msg343365 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2019-05-24 10:29
Example of generated code:    if (!PyBytes_Check(args[15])) {        _PyArg_BadArgument("replace", 16, "bytes", args[15]);        goto exit;    }Error message:TypeError: replace() argument 16 must be bytes, not tupleIt is the 'lnotab' parameter which is a keywoard-only parameter. I expect the parameter name in the error message.Note: I got this error while implementingbpo-37032.
msg343629 -(view)Author: Rémi Lapeyre (remi.lapeyre)*Date: 2019-05-27 14:15
With the attached PR, the error message is now:>>> def f(): pass... >>> code = f.__code__>>> code.replace(co_lnotab=4)Traceback (most recent call last):  File "<stdin>", line 1, in <module>TypeError: replace() argument 'co_lnotab' must be bytes, not int
msg344700 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2019-06-05 10:31
This is a bug. I intentionally committed the simpler code, but forgot to fix it later.
msg344708 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2019-06-05 11:54
> This is a bug. I intentionally committed the simpler code, but forgot to fix it later.I suggest to also apply the fix to 3.8 in that case.
msg350787 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2019-08-29 14:49
New changeset4901fe274bc82b95dc89bcb3de8802a3dfedab32 by Serhiy Storchaka (Rémi Lapeyre) in branch 'master':bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593)https://github.com/python/cpython/commit/4901fe274bc82b95dc89bcb3de8802a3dfedab32
msg350791 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2019-08-29 15:30
New changeset96631dcb11c2786f470d4586bf23ecca14361506 by Serhiy Storchaka in branch '3.8':[3.8]bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593). (GH-15599)https://github.com/python/cpython/commit/96631dcb11c2786f470d4586bf23ecca14361506
msg350793 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2019-08-29 15:52
Thank you Rémi!
msg350799 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2019-08-29 16:37
Thanks, that's a great enhancement!
History
DateUserActionArgs
2022-04-11 14:59:15adminsetgithub: 81215
2019-08-29 16:37:39vstinnersetmessages: +msg350799
2019-08-29 15:52:22serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: +msg350793

stage: patch review -> resolved
2019-08-29 15:30:02serhiy.storchakasetmessages: +msg350791
2019-08-29 15:09:52serhiy.storchakasetpull_requests: +pull_request15275
2019-08-29 14:49:12serhiy.storchakasetmessages: +msg350787
2019-06-05 11:54:27vstinnersetmessages: +msg344708
2019-06-05 10:31:04serhiy.storchakasettype: behavior
messages: +msg344700
versions: + Python 3.9
2019-05-27 14:15:47remi.lapeyresetnosy: +remi.lapeyre
messages: +msg343629
2019-05-27 14:13:42remi.lapeyresetkeywords: +patch
stage: patch review
pull_requests: +pull_request13500
2019-05-24 10:29:45vstinnercreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp