[issue43121] Incorrect SyntaxError message for missing comma (3.10.a5)

2021-05-04 Thread Alex Hall


Alex Hall  added the comment:

Pablo, check out https://github.com/aroberge/friendly/discussions/197, 
particularly the second bullet point which has a dataset of syntax errors.

--
nosy: +alexmojaki

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43121] Incorrect SyntaxError message for missing comma (3.10.a5)

2021-02-03 Thread Andre Roberge


Andre Roberge  added the comment:

Pablo:
The tests are in 
https://github.com/aroberge/friendly-traceback/tree/master/tests/syntax

I plan to soon add at least two dozen more based on recent contributions.


The full results can be seen on the documentation site; for example 
https://aroberge.github.io/friendly-traceback-docs/docs/html/syntax_tracebacks_en_3.9.html

I track changes in error messages from CPython: 
https://aroberge.github.io/friendly-traceback-docs/docs/html/compare.html

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43121] Incorrect SyntaxError message for missing comma (3.10.a5)

2021-02-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks Andre for the thorough explanation!

The reason I was interested in running it myself is that as you are running on 
syntax errors, is a good corpus of things that fail with error messages, which 
is something that we have not been able to find as much as possible when trying 
new developments and proof of concepts. I am more interested in extracting the 
error cases and such so we can use them in future improvements. :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43121] Incorrect SyntaxError message for missing comma (3.10.a5)

2021-02-03 Thread Andre Roberge


Andre Roberge  added the comment:

Pablo: to run the friendly-traceback test suite is simply a matter of typing 
"pytest" from the root directory of the repository (after installing the 
dependencies). However, it would not be helpful for the purpose of CPython 
development, as likely more failing tests would be due to Friendly-traceback 
itself.

As a first step, Friendly-traceback tries to make use of the information given 
by Python (for example, the new "expected ':'"); if it does not recognize the 
message, or if the message is "invalid syntax", it uses some heuristics to 
guess what might be the probable cause. 

Improvements to the messages given by CPython are likely going to initially 
result in failed tests for Friendly-traceback, whether the information provided 
by CPython is valid (most of the time) or not.

The test suite I use includes things that I imagine a beginner might write. For 
example, using "else if" instead of "elif".  With one of the newest additions 
of CPython ("expected ':'") which is accurate in most cases, this specific unit 
test would likely fail until I make the appropriate adjustement to 
Friendly-traceback.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43121] Incorrect SyntaxError message for missing comma (3.10.a5)

2021-02-03 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43121] Incorrect SyntaxError message for missing comma (3.10.a5)

2021-02-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset d4e6ed7e5fb43320ea714d7436bc11667c624d43 by Pablo Galindo in 
branch 'master':
bpo-43121: Fix incorrect SyntaxError message for missing comma (GH-24436)
https://github.com/python/cpython/commit/d4e6ed7e5fb43320ea714d7436bc11667c624d43


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43121] Incorrect SyntaxError message for missing comma (3.10.a5)

2021-02-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Pablo: I have almost exactly the same 4 test cases that you added in the test 
> suite, so it would pass my tests too. I would consider it to be resolved.

Fantastic. Also, for the future, could you indicate how could I run the test 
suite of friendly-traceback?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43121] Incorrect SyntaxError message for missing comma (3.10.a5)

2021-02-03 Thread Andre Roberge


Andre Roberge  added the comment:

Pablo: I have almost exactly the same 4 test cases that you added in the test 
suite, so it would pass my tests too. I would consider it to be resolved.

(For example: 
https://aroberge.github.io/friendly-traceback-docs/docs/html/syntax_tracebacks_en_3.9.html#missing-comma-in-a-set
 -- although I need to fix the suggestions I offer in my own code as they are 
currently wrong.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43121] Incorrect SyntaxError message for missing comma (3.10.a5)

2021-02-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Andre, could you check if this works in your test suite correctly?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43121] Incorrect SyntaxError message for missing comma (3.10.a5)

2021-02-03 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +23244
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24436

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43121] Incorrect SyntaxError message for missing comma (3.10.a5)

2021-02-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks Andre for the report. Will fix it soon

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43121] Incorrect SyntaxError message for missing comma (3.10.a5)

2021-02-03 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43121] Incorrect SyntaxError message for missing comma (3.10.a5)

2021-02-03 Thread Andre Roberge


New submission from Andre Roberge :

A missing comma between list items results in an incorrect message.


Python 3.10.0a5 (tags/v3.10.0a5:b0478d7, Feb  3 2021, 01:44:54) [MSC v.1928 64 
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

>>> a = [1, 2 3]
  File "", line 1
a = [1, 2 3]
 ^
SyntaxError: did you forget parentheses around the comprehension target?

--
messages: 386457
nosy: aroberge
priority: normal
severity: normal
status: open
title: Incorrect SyntaxError message for missing comma (3.10.a5)
type: behavior
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com