[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-02-08 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I am not backporting to 3.9 because the parser is different enough that introducing this would also introduce some unintended side effects. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___

[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-02-08 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 5b58db75291cfbb9b6785c9845824b3e2da01c1c by Pablo Galindo Salgado in branch '3.10': [3.10] bpo-46521: Fix codeop to use a new partial-input mode of the parser (GH-31010). (GH-31213) https://github.com/python/cpython/commit/5b58db75291cfb

[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-02-08 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +29383 pull_request: https://github.com/python/cpython/pull/31213 ___ Python tracker ___ ___

[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-02-08 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 69e10976b2e7682c6d57f4272932ebc19f8e8859 by Pablo Galindo Salgado in branch 'main': bpo-46521: Fix codeop to use a new partial-input mode of the parser (GH-31010) https://github.com/python/cpython/commit/69e10976b2e7682c6d57f4272932ebc19f

[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-01-30 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > The message is off That's because the tokenizer sees the error before the parser even has time to see the other one. Not sure if is technically anything to fix here other than the order of reporting two different errors, which may be a bit tricky to

[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-01-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: With my fix to the PR: >>> a b ''' SyntaxError: unterminated triple-quoted string literal (detected at line 1) >>> a ''' ... The message is off, and can be left for another issue (or not), but the behavior is correct. With the hack removed, all the tests in

[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-01-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thank you for the PR. As I wrote on my preliminary review, I see this likely 1 failure that might may be in the test fixture. Will test and debug later. -- ___ Python tracker _

[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-01-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: If we want to go with this approach, I am going to need help to fix test_idle as I have no idea why is failing if test_codeop passes. -- ___ Python tracker _

[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-01-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Ugh, the approach to do that breaks super heavily test_idle :( -- ___ Python tracker ___ _

[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-01-29 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +29189 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31010 ___ Python tracker __

[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-01-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: >> Pablo, is there any possibility that the internal REPL parser could be >> wrapped, exposed to Python, and called with fake stdin/out/err objects? I would really advise against this. Unfortunately, the state of affairs is that the REPL is somehow su

[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-01-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: Tushar, I am the principle IDLE maintainer and have dealt with similar interactive compile problems on and off for a few years. Code module uses codeop._maybe_compile, which in turn uses batch-mode compile(). To review: Code can be in 3 states: legal, illega