Issue28512
Created on 2016-10-22 21:50 by serhiy.storchaka, last changed 2017-03-31 16:36 by dstufft. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| PyErr_SyntaxLocationObject-offset.patch | serhiy.storchaka, 2016-11-20 22:04 | review | ||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 552 | closed | dstufft, 2017-03-31 16:36 | |
| Messages (7) | |||
|---|---|---|---|
| msg279224 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2016-10-22 21:50 | |
The purpose of PyErr_SyntaxLocationEx() function (added in 00e4ce31d404) 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 in Python/errors.c:1067, but then replaced with None in Python/errors.c:1083. |
|||
| msg281305 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2016-11-20 22:04 | |
Here is a patch that makes PyErr_SyntaxLocationObject() setting correct offset. |
|||
| msg282913 - (view) | Author: Martin Panter (martin.panter) * | Date: 2016-12-11 09:36 | |
Looks good apart from one quirky test case, see Reitveld |
|||
| msg282917 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2016-12-11 12:34 | |
Good catch Martin! Opened issue28936 for that quirky test. |
|||
| msg282918 - (view) | Author: Roundup Robot (python-dev) | Date: 2016-12-11 12:44 | |
New changeset ea1c49ea8136 by Serhiy Storchaka in branch '3.5': Issue #28512: Fixed setting the offset attribute of SyntaxError by https://hg.python.org/cpython/rev/ea1c49ea8136 New changeset df59faf7fa59 by Serhiy Storchaka in branch '3.6': Issue #28512: Fixed setting the offset attribute of SyntaxError by https://hg.python.org/cpython/rev/df59faf7fa59 New changeset 72aaef2d144b by Serhiy Storchaka in branch 'default': Issue #28512: Fixed setting the offset attribute of SyntaxError by https://hg.python.org/cpython/rev/72aaef2d144b |
|||
| msg283055 - (view) | Author: Berker Peksag (berker.peksag) * | Date: 2016-12-12 21:57 | |
Hi Serhiy, there are two commented-out lines in https://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) * | 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 | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2017-03-31 16:36:35 | dstufft | set | pull_requests: + pull_request1082 |
| 2016-12-21 10:12:21 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2016-12-13 07:35:55 | serhiy.storchaka | set | messages: + msg283080 |
| 2016-12-12 21:57:43 | berker.peksag | set | nosy:
+ berker.peksag messages: + msg283055 |
| 2016-12-11 12:44:52 | python-dev | set | nosy:
+ python-dev messages: + msg282918 |
| 2016-12-11 12:34:16 | serhiy.storchaka | set | messages: + msg282917 |
| 2016-12-11 09:36:10 | martin.panter | set | messages: + msg282913 |
| 2016-12-11 08:00:34 | serhiy.storchaka | set | nosy:
+ martin.panter |
| 2016-11-20 22:04:29 | serhiy.storchaka | set | files:
+ PyErr_SyntaxLocationObject-offset.patch keywords: + patch messages: + msg281305 stage: patch review |
| 2016-10-22 21:50:07 | serhiy.storchaka | create | |