Created on 2020-06-15 13:45 by lys.nikolaou, last changed 2020-06-16 00:46 by miss-islington. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 20888 | merged | lys.nikolaou, 2020-06-15 14:35 | |
| PR 20905 | merged | miss-islington, 2020-06-16 00:27 | |
| Messages (6) | |||
|---|---|---|---|
| msg371544 - (view) | Author: Lysandros Nikolaou (lys.nikolaou) * | Date: 2020-06-15 13:45 | |
While investigating bpo-40958, the following came up: When a file ends with a line that contains a line continuation character the text of the emitted SyntaxError is empty, contrary to the old parser, where the error text contained the text of the last line. Here is an example: cpython git:(master)$ cat t.py x = 6\% cpython git:(master)$ ./python t.py File "/home/lysnikolaou/repos/cpython/t.py", line 2 ^ SyntaxError: unexpected EOF while parsing cpython git:(master)$ python3.9 -X oldparser t.py File "/home/lysnikolaou/repos/cpython/t.py", line 2 x = 6\ ^ SyntaxError: unexpected EOF while parsing |
|||
| msg371545 - (view) | Author: Lysandros Nikolaou (lys.nikolaou) * | Date: 2020-06-15 13:50 | |
Copying and pasting the example messed the formatting up. Here it is again.
[16:49:16] lysnikolaou:cpython git:(master*) $ cat t.py
x = 6\% [16:49:23] lysnikolaou:cpython git:(master*) $ ./python t.py
File "/home/lysnikolaou/repos/cpython/t.py", line 2
^
SyntaxError: unexpected EOF while parsing
[16:49:56] lysnikolaou:cpython git:(master*) $ python3.9 -X oldparser t.py
File "/home/lysnikolaou/repos/cpython/t.py", line 2
x = 6\
^
SyntaxError: unexpected EOF while parsing
|
|||
| msg371547 - (view) | Author: Lysandros Nikolaou (lys.nikolaou) * | Date: 2020-06-15 13:53 | |
I keep doing something wrong. I hope it is clean by now what the difference is. |
|||
| msg371584 - (view) | Author: Guido van Rossum (gvanrossum) * | Date: 2020-06-15 18:47 | |
Yes, it's clear. :-) This is one reason we need to migrate off bpo and onto GitHub. |
|||
| msg371609 - (view) | Author: Pablo Galindo Salgado (pablogsal) * | Date: 2020-06-16 00:27 | |
New changeset 113e2b0a07c72c0d5e3489076afb14f6b3ad1049 by Lysandros Nikolaou in branch 'master': bpo-40985: Show correct SyntaxError text when last line has a LINECONT (GH-20888) https://github.com/python/cpython/commit/113e2b0a07c72c0d5e3489076afb14f6b3ad1049 |
|||
| msg371610 - (view) | Author: miss-islington (miss-islington) | Date: 2020-06-16 00:46 | |
New changeset 097b8b6d52e3d4991c68dce74f182718dc0eab9c by Miss Islington (bot) in branch '3.9': bpo-40985: Show correct SyntaxError text when last line has a LINECONT (GH-20888) https://github.com/python/cpython/commit/097b8b6d52e3d4991c68dce74f182718dc0eab9c |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2020-06-16 00:46:51 | miss-islington | set | messages: + msg371610 |
| 2020-06-16 00:29:43 | lys.nikolaou | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2020-06-16 00:27:56 | miss-islington | set | nosy:
+ miss-islington pull_requests: + pull_request20088 |
| 2020-06-16 00:27:41 | pablogsal | set | messages: + msg371609 |
| 2020-06-15 18:47:44 | gvanrossum | set | messages: + msg371584 |
| 2020-06-15 14:35:11 | lys.nikolaou | set | keywords:
+ patch stage: patch review pull_requests: + pull_request20071 |
| 2020-06-15 13:53:55 | lys.nikolaou | set | messages: + msg371547 |
| 2020-06-15 13:53:32 | lys.nikolaou | set | nosy:
+ gvanrossum, pablogsal |
| 2020-06-15 13:50:22 | lys.nikolaou | set | messages: + msg371545 |
| 2020-06-15 13:45:34 | lys.nikolaou | create | |