[issue40813] Output SyntaxError is not defective

2020-09-24 Thread Irit Katriel
Irit Katriel added the comment: I don't think it's true that the lineno is correct when compiling a string (Remi's string is just too short): >>> try: ... compile('if __name__ == "__main__":\n print("hello world"\n x=5\n', '', 'exec') ... except SyntaxError as e: ... print("e.lin

[issue40813] Output SyntaxError is not defective

2020-05-29 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Indeed, the exception has the correct line number when compiling manually: >>> try: ... compile('if __name__ == "__main__":\n print("hello world"\n', '', 'exec') ... except SyntaxError as e: ... print(e.lineno) ... 2 but not when running `python3 ma

[issue40813] Output SyntaxError is not defective

2020-05-29 Thread timofej
timofej added the comment: About of numbers of line. I tested on different files and i forget change number of line. -- ___ Python tracker ___ ___

[issue40813] Output SyntaxError is not defective

2020-05-29 Thread timofej
timofej added the comment: here attached file with SyntaxError -- Added file: https://bugs.python.org/file49201/main.py ___ Python tracker ___

[issue40813] Output SyntaxError is not defective

2020-05-29 Thread Zachary Ware
Change by Zachary Ware : -- type: compile error -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue40813] Output SyntaxError is not defective

2020-05-29 Thread Zachary Ware
Zachary Ware added the comment: Without some example code, there's no way to really tell what's going on here. In particular, it's suspicious that you're expecting an error on line 7 but seeing one on line 3. Can you attach your `main.py` file to the issue? -- components: +Interpre

[issue40813] Output SyntaxError is not defective

2020-05-29 Thread timofej
New submission from timofej : a SyntaxError must be look like: File "main.py", line 7 print("hello world" ^ SyntaxError: unexpected EOF while parsing but instead of this i'm get this: File "main.py", line 3 ^ SyntaxError: unexpected EOF wh