[issue47156] IDLE: make use of extended SyntaxError info.

2022-03-29 Thread Andre Roberge
Andre Roberge added the comment: > (Anyone really want log of error?) If by this you mean having access to the error from a known place (like sys.last_traceback or something else specific to IDLE but available from a script), then the answer from me is definitely yes. -- n

[issue46902] Typo hint message for from-imports?

2022-03-02 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue46902> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46838] Parameters and arguments parser syntax error improvments

2022-02-25 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue46838> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46652] Use code.co_qualname to provide richer information

2022-02-05 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue46652> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue46637> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43476] Enabling access to showsyntaxerror for IDLE's shell

2022-01-14 Thread Andre Roberge
Andre Roberge added the comment: As far as I am concerned, this issue can be closed. I have found a workaround which allows me to reproduce and analyze the SyntaxError that are not captured by custom exception hook. -- ___ Python tracker <ht

[issue46237] Incorrect line reported in syntax error

2022-01-07 Thread Andre Roberge
Andre Roberge added the comment: > This also affects 3.9 I imagine, no? Yes. And, from what I can tell, the same incorrect line is indicated at least all the way back to Python 3.6 (where it was "invalid token" instead of "invalid decimal literal).

[issue46291] [doc] First argument to raise can also be BaseException

2022-01-07 Thread Andre Roberge
Andre Roberge added the comment: >> For this advice (catching Exception and not BaseException) to be correct, >> users should be advised (as they are in the tutorial) to raise exceptions >> derived from Exception (and not BaseException). > I disagree with that. You

[issue46291] [doc] First argument to raise can also be BaseException

2022-01-07 Thread Andre Roberge
Andre Roberge added the comment: Irit: In all the books and tutorials I have seen, the advice is to try to catch specific exceptions whenever possible or, *at most*, to catch Exception (and not BaseException). This is to allow, for example, a program to be interrupted

[issue46291] [doc] First argument to raise can also be BaseException

2022-01-07 Thread Andre Roberge
Andre Roberge added the comment: Irit: Gregor indicates that, while the tutorial refers to "a class that derives from Exception", the Python Reference Language states exceptions should be subclasses of BaseException (which Exception *is*). You then invited Gregor to subm

[issue46291] [doc] First argument to raise can also be BaseException

2022-01-07 Thread Andre Roberge
Andre Roberge added the comment: In https://docs.python.org/3/library/exceptions.html#Exception, it is written: "All built-in, non-system-exiting exceptions are derived from this class. All user-defined exceptions should also be derived from this class." Yes, technically, the r

[issue46240] Incorrect hint about forgetting a comma

2022-01-03 Thread Andre Roberge
New submission from Andre Roberge : Given the following code containing an unclosed parenthesis: a = (1, 2 b = 3 Here is the resulting SyntaxError: > python ignore.py File "C:\...\ignore.py", line 1 a = (1, 2 ^ SyntaxError: invalid syntax. Perhaps you f

[issue44780] Incorrect message: "Invalid decimal literal" (python 3.10)

2021-12-26 Thread Andre Roberge
Andre Roberge added the comment: The last of these three cases (with FRACTION SLASH) is fixed 3.10.1. The other two are still present in 3.10.1 and in 3.11.0a3 -- versions: +Python 3.11 ___ Python tracker <https://bugs.python.org/issue44

[issue46042] Error range of "duplicate argument" SyntaxErrors is too big

2021-12-10 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue46042> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46004] Incorrect bad token identified in 3.10.1

2021-12-06 Thread Andre Roberge
Andre Roberge added the comment: >From >(https://friendly-traceback.github.io/docs/syntax_tracebacks_en_3.10.html#for-loop-missing-in-operator), > this is what was shown for Python 3.10.0 for x range(4): ^^ SyntaxError: invalid syntax. Perhaps you forgot a com

[issue46004] Incorrect bad token identified in 3.10.1

2021-12-06 Thread Andre Roberge
New submission from Andre Roberge : In Python 3.10.1, a change occurred compared with 3.10.0 so that an incorrect token is flagged for a SyntaxError. Also, in 3.11.0a2, the suggestion made about having forgotten a comma is incorrect. Python 3.10.1 for x range(4

[issue44166] Make IndexError messages for list more informative

2021-12-05 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue44166> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45812] SystemError when using code.interact

2021-11-16 Thread Andre Roberge
Andre Roberge added the comment: I am sorry, but I am not set up to work from the main branch and must rely on official releases. In the future, for alpha and beta releases, I will try to wait for the next release, see immediately if I can reproduce bugs that I had noted before, and submit

[issue45812] SystemError when using code.interact

2021-11-15 Thread Andre Roberge
New submission from Andre Roberge : In the following, I execute a single invalid statement in the Python interpreter, which gives the correct error message. Afterwards, I repeat this example using code.interact(), generating a different traceback. This issue affects IDLE differently as shown

[issue45811] Improve error message when source code contains invisible control characters

2021-11-15 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue45811> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45807] Strange SyntaxError message / suggestions for "@x = 123"

2021-11-15 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue45807> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45801] Incorrect "Perhaps you forgot a comma" hint

2021-11-13 Thread Andre Roberge
Andre Roberge added the comment: I understand. I reported this issue when one of my newest tests failed with Python 3.10 and 3.11. Actually, using friendly-traceback, using the location of the exception as indicated by cPython 3.10 and 3.11, here's part of the explanation it gives

[issue45801] Incorrect "Perhaps you forgot a comma" hint

2021-11-13 Thread Andre Roberge
New submission from Andre Roberge : Python 3.10 and 3.11: >>> sum[i for i in [1, 2, 3] if i%2==0] File "", line 1 sum[i for i in [1, 2, 3] if i%2==0] ^^^ SyntaxError: invalid syntax. Perhaps you forgot a comma? Furthe

[issue45781] Deleting __debug__ should be an SyntaxError

2021-11-12 Thread Andre Roberge
Andre Roberge added the comment: What version are you using? As far as I can test, it has become a syntax error since 3.10. Here is the result with the latest 3.11 alpha > python Python 3.11.0a2 (tags/v3.11.0a2:e2b4e4b, Nov 5 2021, 20:00:05) [MSC v.1929 64 bit (AMD64)] on win32 Type &q

[issue45738] 3.11 exec raises SystemError instead of SyntaxError on char after line continuation

2021-11-12 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue45738> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45759] Improve error messages for non-matching `elif`/`else` statements

2021-11-09 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue45759> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45721] Improve error message when python shell command is entered at the REPL prompt

2021-11-05 Thread Andre Roberge
Andre Roberge added the comment: I think that "trying to run a shell command" might not be easy to understand by a beginner. If the special case of r"python\s+" is added, perhaps r"pip\s+" should be considered as well since many sites on the Internet suggest t

[issue45716] Confusing parsing error message when trying to use True as keyword argument

2021-11-04 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue45716> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45607] Make it possible to enrich an exception's error message

2021-10-25 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue45607> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45560] sys.last_* not set for SyntaxErrors with IDLE

2021-10-21 Thread Andre Roberge
Andre Roberge added the comment: If this can be implemented, then I believe that https://bugs.python.org/issue43476 could be closed as well. -- ___ Python tracker <https://bugs.python.org/issue45

[issue45560] sys.last_* not set for SyntaxErrors with IDLE

2021-10-21 Thread Andre Roberge
New submission from Andre Roberge : As stated in the documentation, sys.last_type, sys.last_value and sys.last_traceback ... are set when an exception is not handled and the interpreter prints an error message and a stack traceback. This is true whether the exception is a SyntaxError or some

[issue45450] Improve syntax error for parenthesized arguments

2021-10-12 Thread Andre Roberge
Andre Roberge added the comment: +1 on adding better error messages for these cases. I also agree with having different explanations with lambda and def. Below is what I have with friendly-traceback: perhaps the first line of both of these might be suitable? (I will likely change

[issue45450] Improve syntax error for parenthesized arguments

2021-10-12 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue45450> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24612] not operator expression raising a syntax error

2021-09-04 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue24612> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45000] del __debug__ should be a SyntaxError

2021-08-25 Thread Andre Roberge
New submission from Andre Roberge : Consider the following: Python 3.10.0rc1 ... >>> __debug__ True >>> del __debug__ Traceback (most recent call last): File "", line 1, in NameError: name '__debug__' is not defined >>> __debug__ True >>> _

[issue44947] SyntaxError: trailing comma not allowed ... misleading

2021-08-18 Thread Andre Roberge
Andre Roberge added the comment: Based on what I just read on https://github.com/davidhalter/parso/blob/master/parso/python/issue_list.txt I gather that this exception is only raised in the context of an import statement with a trailing comma (usually followed by nothing

[issue44947] SyntaxError: trailing comma not allowed ... misleading

2021-08-18 Thread Andre Roberge
Andre Roberge added the comment: This message is not new to Python 3.10 as it is also shown with Python 3.9.5. >>> from math import sin, cos, and tan File "", line 1 from math import sin, cos, and tan ^ SyntaxError: trailing comma

[issue44947] SyntaxError: trailing comma not allowed ... misleading

2021-08-18 Thread Andre Roberge
New submission from Andre Roberge : Consider the following four slightly different examples: Python 3.10.0rc1 ... >>> from math import sin and cos File "", line 1 from math import sin and cos ^^^ SyntaxError: invalid syntax >>&g

[issue34013] Inconsistent SyntaxError for print

2021-08-10 Thread Andre Roberge
Andre Roberge added the comment: Python 3.10.0rc1 ... >>> print hello world! File "", line 1 print hello world! ^^^ SyntaxError: invalid syntax. Perhaps you forgot a comma? The hint given is not exactly helpful ... (This example was in a discussio

[issue44838] SyntaxError: New message "expected 'else' after 'if' expression" wrongly shown

2021-08-05 Thread Andre Roberge
Andre Roberge added the comment: I have no idea how the parser works ... but when you do the test to identify if an 'else' is missing, could the fact that there is a colon instead of the expected 'else' be used to avoid misidentifying this case? Note: I am keenly aware of the difficulties

[issue44838] SyntaxError: New message "expected 'else' after 'if' expression" wrongly shown

2021-08-05 Thread Andre Roberge
New submission from Andre Roberge : Given the following code containing no if expression (only if statements): if True: print('hello' if 2: print(123)) The following traceback is generated in Python 3.10.0RC1 File "...\example.py", line 2 pr

[issue44792] Improve syntax errors for invalid if expressions

2021-07-31 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue44792> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44780] Incorrect message: "Invalid decimal literal" (python 3.10)

2021-07-30 Thread Andre Roberge
Andre Roberge added the comment: Third case. Showing only the output for Python 3.10 >>> a = 3 ⁄ 7 # entered with a space around ⁄ File "", line 1 a = 3 ⁄ 7 ^ SyntaxError: invalid character '⁄' (U+2044) >>> a = 3⁄7# no added space

[issue44780] Incorrect message: "Invalid decimal literal" (python 3.10)

2021-07-30 Thread Andre Roberge
Andre Roberge added the comment: Here's another related case. Python 3.9: >>> a = 1½ File "", line 1 a = 1½ ^ SyntaxError: invalid character '½' (U+00BD) Python 3.10 >>> a = 1½ File "", line 1 a = 1½

[issue44780] Incorrect message: "Invalid decimal literal" (python 3.10)

2021-07-30 Thread Andre Roberge
New submission from Andre Roberge : Consider the following: >>> a = (1‚ 2) # not a comma, but unicode character. Using Python 3.9 (and earlier), we get the following correct information >>> a = (1‚ 2) File "", line 1 a = (1‚ 2) ^ SyntaxError: i

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-16 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue44648> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11343] Make errors due to full parser stack identifiable

2021-07-08 Thread Andre Roberge
Andre Roberge added the comment: @pablo: Sincere apologies ... I tested this with the wrong virtual environment active locally. With 3.10, it is indeed SyntaxError: too many nested parentheses -- ___ Python tracker <https://bugs.python.

[issue11343] Make errors due to full parser stack identifiable

2021-07-08 Thread Andre Roberge
Andre Roberge added the comment: For information: I created an actual .py file from the last example with 200 parens and got the following error message: > python example.py s_push: parser stack overflow MemoryError For consistency and greater clarity, I think that having messa

[issue44576] AttributeError: incorrect line identified in Python 3.10

2021-07-07 Thread Andre Roberge
Andre Roberge added the comment: While I filed the original report, I am in agreement that accurate information for debugging tools is definitely more important than the quick summary shown in the traceback, and that the change likely represents an improvement in situations more realistic

[issue44576] AttributeError: incorrect line identified in Python 3.10

2021-07-07 Thread Andre Roberge
New submission from Andre Roberge : Consider the following program # example.py one = 1 two = "two" a = [one . two] Running this program with Python versions before 3.10, yields the following traceback: Traceback (most recent call last): File "C:\Users\andre\exam

[issue43950] Include column offsets for bytecode instructions

2021-06-29 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue43950> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43476] Enabling access to showsyntaxerror for IDLE's shell

2021-06-28 Thread Andre Roberge
Andre Roberge added the comment: I made an error in my previous comment: the code I wrote is obviously incorrect as it contains a SyntaxError. -- ___ Python tracker <https://bugs.python.org/issue43

[issue43476] Enabling access to showsyntaxerror for IDLE's shell

2021-06-22 Thread Andre Roberge
Andre Roberge added the comment: I can confirm that, if the existing line type, value, tb = sys.exc_info() in pyshell.ModifiedInterpreter.showsyntaxerror is replaced by e_type, value, tb = sys.exc_info() err = str((type(e_type).__name__, *value)+'\n' linecache.cache[""] = (len(err

[issue43476] Enabling access to showsyntaxerror for IDLE's shell

2021-06-21 Thread Andre Roberge
Andre Roberge added the comment: Unless I am mistaken, when compiling the code, both SyntaxError and OverflowError instances are caught at the same stage, and likely passed on to showsyntaxerror. For OverflowError, e.args is not normally a tuple but a string, and *e.args[1] would raise

[issue43476] Enabling access to showsyntaxerror for IDLE's shell

2021-06-21 Thread Andre Roberge
Andre Roberge added the comment: Having a fake file with a single line containing all the exception information as described would definitely provide all the required information needed. It would be much better than what I had suggested previously

[issue43476] Enabling access to showsyntaxerror for IDLE's shell

2021-06-20 Thread Andre Roberge
Andre Roberge added the comment: I just thought of making a copy of the file content under a known name as the least disruptive approach for IDLE's code - even less so than the recent addition required to support user-defined exception hooks. For SyntaxErrors and subclasses [1], Friendly

[issue43476] Enabling access to showsyntaxerror for IDLE's shell

2021-06-19 Thread Andre Roberge
Andre Roberge added the comment: Would it be possible to add a single line of code to idlelib's pyshell.py, as indicated below: def showsyntaxerror(self, filename=None): """... """ linecache.cache[""] = linecache.cache[filename

[issue44448] Suggestion: change existing error message for invalid function name

2021-06-17 Thread Andre Roberge
New submission from Andre Roberge : Consider the following two examples with the latest beta release: Python 3.10.0b3 ... >>> def 3job(x): File "", line 1 def 3job(x): ^ SyntaxError: invalid imaginary literal >>> def 3ob(x): F

[issue44447] Syntax Error not as detailed as shown

2021-06-17 Thread Andre Roberge
Andre Roberge added the comment: Your example is different than the one in the documentation (What's new). >>> (x, x for x in range(7)) # Your example File "", line 1 (x, x for x in range(7)) ^^^ SyntaxError: invalid syntax >>> foo(x, x for x in

[issue44324] add a "expected expression" syntax error

2021-06-17 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue44324> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44369] Improve syntax error for wrongly closed strings

2021-06-09 Thread Andre Roberge
Andre Roberge added the comment: I like this. While it would be a bit longer, I'm wondering if the message should not read instead as follows: ... Did you use the same quotes here as those enclosing the string? === I suspect that errors coming from the use of a single quote, as in: 'Don't

[issue44335] "Wrong" invalid character identified

2021-06-07 Thread Andre Roberge
New submission from Andre Roberge : When using Python 3.10.0b2 on a line with more than one invalid characters, the second one is identified as being incorrect, whereas in previous versions the first such character was identified. > py -3.8 unicode_quote.py File "unicode_quote.py&

[issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows?

2021-06-04 Thread Andre Roberge
Andre Roberge added the comment: Terry: I just checked with Idle on Windows with Python 3.9.5 and the display works perfectly, with no incorrect characters. -- ___ Python tracker <https://bugs.python.org/issue44

[issue37041] IDLE: path browser unusable on some displays

2021-06-03 Thread Andre Roberge
Change by Andre Roberge : -- status: open -> closed ___ Python tracker <https://bugs.python.org/issue37041> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue44273] Assigning to Ellipsis should be the same as assigning to __debug__

2021-05-31 Thread Andre Roberge
Andre Roberge added the comment: Up to your best judgment Pablo - and thanks for your ongoing work on improving error messages. -- ___ Python tracker <https://bugs.python.org/issue44

[issue44273] Assigning to Ellipsis should be the same as assigning to __debug__

2021-05-31 Thread Andre Roberge
Andre Roberge added the comment: > > I think that the suggestion to explicitly refer to '...' instead of the name Ellipsis would be preferable. Aside: I had not realized that this was done at a different stage for __debug__ and Ellipsis ("Ignorance is bliss"...

[issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows?

2021-05-31 Thread Andre Roberge
Andre Roberge added the comment: I observe something similar, though with different symbols. My Windows installation uses French (fr-ca) as default language. === help> COMPARISON Comparisons *** ... Formally, if *a*, *b*, *c*, à, *y*, *z* are expressions and *op1*, *op2*, à, *

[issue44273] Assigning to Ellipsis should be the same as assigning to __debug__

2021-05-31 Thread Andre Roberge
New submission from Andre Roberge : Consider the following in Python 3.10 >>> ... = 1 File "", line 1 ... = 1 ^^^ SyntaxError: cannot assign to Ellipsis here. Maybe you meant '==' instead of '='? >>> __debug__ = 1 File "", line 1 SyntaxError

[issue44201] REPL requests another line despite syntax error

2021-05-21 Thread Andre Roberge
Andre Roberge added the comment: I believe that this is similar to, but not quite as severe as a similar bug in code.interact() https://bugs.python.org/issue43366 which affects IDLE; perhaps fixing this might fix the other issue? -- nosy: +aroberge

[issue44181] SyntaxError in Python 3.10.0b1: wrong token for missing comma

2021-05-19 Thread Andre Roberge
New submission from Andre Roberge : When forgetting a comma in writing a dict literal spanning multiple lines, the "bad token" is wrongly idenfied with Python 3.10.0b1. >>> a = {'a': 1 ... 'b': 2 File "", line 1 a = {'a': 1 ^ SyntaxError

[issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal

2021-05-19 Thread Andre Roberge
Andre Roberge added the comment: In the second case, I understand very well that it could have been a set literal. In my (limited) experience, I have never seen a set literal containing a single element obtained from an == comparison. Since dict can be built by using keyword arguments, I

[issue44180] SyntaxError misidentified in 3.10.0b1 when = used instead of : in dict literal

2021-05-19 Thread Andre Roberge
New submission from Andre Roberge : When an equal sign is used instead of a colon in creating a dict literal, depending on the context, either the "bad token" is misidentified OR the would-be helpful error message is incorrect in this particular case. 1) Example of bad token.

[issue44026] IDLE: print "Did you mean?" for AttributeError and NameError

2021-05-05 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue44026> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43914] Highlight invalid ranges in SyntaxErrors

2021-04-25 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue43914> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43859] Improve syntax error for indentation errors

2021-04-16 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue43859> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38530] Offer suggestions on AttributeError and NameError

2021-04-14 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue38530> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43797] Improve syntax error for invalid comparisons

2021-04-09 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue43797> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43748] Inconsistent grammar in new error message (introduced in 3.10.0a7)

2021-04-06 Thread Andre Roberge
Andre Roberge added the comment: Since all the messages I track so far (https://github.com/aroberge/friendly/blob/master/friendly/syntax_errors/message_analyzer.py) had been changed when going from 6.7 to 3.8, I had (incorrectly) assumed that all such error messages been changed to use

[issue43748] Inconsistent grammar in new error message (introduced in 3.10.0a7)

2021-04-06 Thread Andre Roberge
New submission from Andre Roberge : Python version 3.10.0a7 added a more informative error message for: >>> f"{**k}" File "", line 1 (**k) ^ SyntaxError: f-string: can't use double starred expression here Previously, the message was simply "

[issue43555] Location of SyntaxError with new parser missing (after continuation character)

2021-03-19 Thread Andre Roberge
New submission from Andre Roberge : Normally, for SyntaxErrors, the location of the error is indicated by a ^. There is at least one case where the location is missing for 3.9 and 3.10.0a6 where it was shown before. Using the old parser for 3.9, or with previous versions of Python

[issue43476] Enabling access to showsyntaxerror for IDLE's shell

2021-03-11 Thread Andre Roberge
New submission from Andre Roberge : As a result of https://bugs.python.org/issue43008, IDLE now supports custom exception hook for almost all cases except for code entered in the interactive shell that result in SyntaxError. It would be useful for some applications if a way to replace

[issue43366] Unclosed bracket bug in code.interact prevents identifying syntax errors

2021-03-02 Thread Andre Roberge
Andre Roberge added the comment: I understand the challenge of reproducing the behaviour of the Python interpreter for this case. If it cannot be reproduced, then the documentation for https://docs.python.org/3/library/code.html#code.InteractiveConsole.interact and others on that page

[issue43304] THONNY 3.3.0 failing to install package MULTIPROCESSING

2021-02-23 Thread Andre Roberge
Andre Roberge added the comment: Thonny has its own discussion site where you can report such problems: https://groups.google.com/g/thonny -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue43

[issue34013] Inconsistent SyntaxError for print

2021-02-19 Thread Andre Roberge
Andre Roberge added the comment: +1 to the idea of adding something to the grammar, and have a simple error message: SyntaxError: Missing parentheses in call to 'print'. in *all* cases, including the first one that prompted this bug report. I write that even though I have created a third

[issue18163] Add a 'key' attribute to KeyError

2021-02-18 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue18163> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43163] code.interact() unexpectedly raises exception when there may be more code

2021-02-08 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue43163> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43149] Misleading error message for except with missing parens (3.10.a5)

2021-02-06 Thread Andre Roberge
New submission from Andre Roberge : The following: try: pass except ValueError, NameError as err: pass results in: except ValueError, NameError as err: ^ SyntaxError: expected ':' However, what is missing here are some parentheses surrounding the exception

[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-02-03 Thread Andre Roberge
Andre Roberge added the comment: Terry: as per your earlier comment, I have tried to use Friendly-traceback with the latest version. While it does set the exception hook correctly, it is not useful. Friendly-traceback (FT) needs to have access to the code that was executed. FT's REPL

[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

[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 l

[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

[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"

[issue43117] Translation Mistakes

2021-02-03 Thread Andre Roberge
Andre Roberge added the comment: A similar error exists in the table for the French documentation where "valeurs" is indicated to be one of the options https://docs.python.org/fr/3.8/library/tkinter.ttk.html#widget -- nosy: +aroberge

[issue43017] Improve error message in the parser when using un-parenthesised tuples in comprehensions

2021-01-25 Thread Andre Roberge
Andre Roberge added the comment: Such a change would be very useful and appreciated by other users as reported on https://github.com/aroberge/friendly-traceback/issues/167 and asked about on StackOverflow https://stackoverflow.com/questions/60986850/why-does-creating-a-list-of-tuples-using

[issue36086] Split IDLE into separate feature in Windows installer

2021-01-25 Thread Andre Roberge
Andre Roberge added the comment: I do not use IDLE (except for testing) and would not be affected by such a change. However, many tutorials and books intended for beginners instruct users to use IDLE, with the assumption that it is available out of the box. Removing IDLE would immediately

[issue43008] IDLE ignores sys.excepthook in normal, subprocess mode

2021-01-23 Thread Andre Roberge
Andre Roberge added the comment: Terry: I will put it on my todo list. Friendly-traceback can currently work (indirectly) with IDLE; see https://aroberge.github.io/friendly-traceback-docs/docs/html/editor.html I am not sure what benefit this patch will yield when it comes to using

[issue42955] Add sys.module_names: list of stdlib module names (Python and extension modules)

2021-01-22 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue42955> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42997] Improve error message for missing : before suites

2021-01-22 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker <https://bugs.python.org/issue42997> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42577] Unhelpful syntax error when expression spans multiple lines

2020-12-11 Thread Andre Roberge
Andre Roberge added the comment: I suspect that the Python parser cannot easily be changed to given any other message. Replace the colon by "else" and add one more closing parenthesis and you have a valid Python program. So, is it a matter of an unclosed parenthesis, or not u

[issue41488] Unusable type hint should not be silently ignored

2020-08-05 Thread Andre Roberge
New submission from Andre Roberge : The following code is currently consistent with the type hint syntax but contains a line that is completely ignored. >>> d = {} >>> d['a']: int >>> d {} >>> __annotations__ {} >>> '_

  1   2   >