Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue26312

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:Raise SystemError on programmical errors in PyArg_Parse*()
Type:enhancementStage:resolved
Components:Interpreter CoreVersions:Python 3.6
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: serhiy.storchakaNosy List: Jim.Jewett, martin.panter, python-dev, serhiy.storchaka, vstinner
Priority:normalKeywords:patch

Created on2016-02-08 19:39 byserhiy.storchaka, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
pyarg_parse_error.patchserhiy.storchaka,2016-02-08 19:39review
Messages (8)
msg259877 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-02-08 19:39
For now programmical errors with the use of PyArg_ParseTuple() cause raising SystemError. But some programmical errors with the use of PyArg_ParseTupleAndKeywords() cause raising RuntimeError. I think that SystemError is the correct exception type.Proposed patch replaces RuntimeError with SystemError in PyArg_ParseTupleAndKeywords(). This change shouldn't break any code (except CPython tests for PyArg_ParseTupleAndKeywords()), because this exception never raised if PyArg_Parse*() functions are used correctly.
msg259916 -(view)Author: Martin Panter (martin.panter)*(Python committer)Date: 2016-02-09 06:46
Seems like a reasonable change and patch to me.
msg260049 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2016-02-10 22:29
Yeah, I also expect SystemError from C functions (of the Python C API) badly used.RuntimeError is more used in programming bugs at Python level.pyarg_parse_error.patch LGTM.
msg260059 -(view)Author: Jim Jewett (Jim.Jewett)*(Python triager)Date: 2016-02-10 23:30
It feels a bit odd to say that I've performed a triage review given the three people already involved -- but I did, and I think it is ready to commit.I believe it is a bug fix, but too subtle a bug to justify backporting.The only question is whether there should be a "What's New?" entry for the change.
msg260064 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2016-02-11 01:18
> The only question is whether there should be a "What's New?" entry for the change.I don't think so. It's low level and nobody should see this exception anyway :-) It's an obvious bug in a C extension.
msg260083 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-02-11 10:23
SystemError is not new exception. It could be raised on other programming bugs. In any case I doesn't expect that anybody catches such exceptions.
msg260084 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2016-02-11 10:42
New changesetc7eff18f3840 by Serhiy Storchaka in branch 'default':Issue#26312: SystemError is now raised in all programming bugs with usinghttps://hg.python.org/cpython/rev/c7eff18f3840
msg260090 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-02-11 11:33
Thanks for your review.
History
DateUserActionArgs
2022-04-11 14:58:27adminsetgithub: 70500
2016-02-11 11:33:18serhiy.storchakasetstatus: open -> closed
messages: +msg260090

assignee:serhiy.storchaka
resolution: fixed
stage: commit review -> resolved
2016-02-11 10:42:20python-devsetnosy: +python-dev
messages: +msg260084
2016-02-11 10:23:24serhiy.storchakasetmessages: +msg260083
2016-02-11 01:18:44vstinnersetmessages: +msg260064
2016-02-10 23:30:29Jim.Jewettsetnosy: +Jim.Jewett

messages: +msg260059
stage: patch review -> commit review
2016-02-10 22:29:47vstinnersetnosy: +vstinner
messages: +msg260049
2016-02-09 06:46:58martin.pantersetnosy: +martin.panter
messages: +msg259916
2016-02-08 19:39:33serhiy.storchakacreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp