Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue28512

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:PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject() always set the offset attribute to None
Type:behaviorStage:resolved
Components:Interpreter CoreVersions:Python 3.7, Python 3.6, Python 3.5
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: benjamin.peterson, berker.peksag, martin.panter, python-dev, serhiy.storchaka
Priority:normalKeywords:patch

Created on2016-10-22 21:50 byserhiy.storchaka, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
PyErr_SyntaxLocationObject-offset.patchserhiy.storchaka,2016-11-20 22:04review
Pull Requests
URLStatusLinkedEdit
PR 552closeddstufft,2017-03-31 16:36
Messages (7)
msg279224 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-10-22 21:50
The purpose of PyErr_SyntaxLocationEx() function (added in00e4ce31d404) was setting the offset attribute of raised syntax error to specified value. But this never worked as expected. The offset attribute is set to integer value inPython/errors.c:1067, but then replaced with None inPython/errors.c:1083.
msg281305 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-11-20 22:04
Here is a patch that makes PyErr_SyntaxLocationObject() setting correct offset.
msg282913 -(view)Author: Martin Panter (martin.panter)*(Python committer)Date: 2016-12-11 09:36
Looks good apart from one quirky test case, see Reitveld
msg282917 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-12-11 12:34
Good catch Martin! Openedissue28936 for that quirky test.
msg282918 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2016-12-11 12:44
New changesetea1c49ea8136 by Serhiy Storchaka in branch '3.5':Issue#28512: Fixed setting the offset attribute of SyntaxError byhttps://hg.python.org/cpython/rev/ea1c49ea8136New changesetdf59faf7fa59 by Serhiy Storchaka in branch '3.6':Issue#28512: Fixed setting the offset attribute of SyntaxError byhttps://hg.python.org/cpython/rev/df59faf7fa59New changeset72aaef2d144b by Serhiy Storchaka in branch 'default':Issue#28512: Fixed setting the offset attribute of SyntaxError byhttps://hg.python.org/cpython/rev/72aaef2d144b
msg283055 -(view)Author: Berker Peksag (berker.peksag)*(Python committer)Date: 2016-12-12 21:57
Hi Serhiy, there are two commented-out lines inhttps://hg.python.org/cpython/rev/ea1c49ea8136#l3.10 (only in 3.5)+        #with self.assertRaises(AssertionError):+            #support.check_syntax_error(self, "x=1")
msg283080 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-12-13 07:35
Ah, it was a remnants of backporting to 3.5. Commented-out lines are used in 3.6. The line above these lines was used in 3.5. Test is passed with both variants. I commented out the 3.6 variant, but forgot to remove it (or remove old 3.5 variant and keep 3.6 variant). Do you think I should remove commented out lines, or left the code as is?
History
DateUserActionArgs
2022-04-11 14:58:38adminsetgithub: 72698
2017-03-31 16:36:35dstufftsetpull_requests: +pull_request1082
2016-12-21 10:12:21serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2016-12-13 07:35:55serhiy.storchakasetmessages: +msg283080
2016-12-12 21:57:43berker.peksagsetnosy: +berker.peksag
messages: +msg283055
2016-12-11 12:44:52python-devsetnosy: +python-dev
messages: +msg282918
2016-12-11 12:34:16serhiy.storchakasetmessages: +msg282917
2016-12-11 09:36:10martin.pantersetmessages: +msg282913
2016-12-11 08:00:34serhiy.storchakasetnosy: +martin.panter
2016-11-20 22:04:29serhiy.storchakasetfiles: +PyErr_SyntaxLocationObject-offset.patch
keywords: +patch
messages: +msg281305

stage: patch review
2016-10-22 21:50:07serhiy.storchakacreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp