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

2021-11-14 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Works for me as well. Thanks.

--

___
Python tracker 

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



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

2021-11-14 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



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

2021-11-14 Thread PEW's Corner


PEW's Corner  added the comment:

Seems to work. Thanks!

--

___
Python tracker 

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



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

2021-11-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 142fcb40b6e460fa9b4a89fe9846b1ce4176354e by Pablo Galindo Salgado 
in branch '3.9':
bpo-45738: Fix computation of error location for invalid continuation 
characters in the parser (GH-29550) (GH-29552)
https://github.com/python/cpython/commit/142fcb40b6e460fa9b4a89fe9846b1ce4176354e


--

___
Python tracker 

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



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

2021-11-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This should be fixed by now, but please, check if everything is in order in 
your respective test suites and confirm here.

--

___
Python tracker 

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



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

2021-11-13 Thread miss-islington


miss-islington  added the comment:


New changeset bf26a6da7aaedb526c9eb1cb56b0e46d1c10384c by Miss Islington (bot) 
in branch '3.10':
bpo-45738: Fix computation of error location for invalid continuation (GH-29550)
https://github.com/python/cpython/commit/bf26a6da7aaedb526c9eb1cb56b0e46d1c10384c


--

___
Python tracker 

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



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

2021-11-13 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +27801
pull_request: https://github.com/python/cpython/pull/29552

___
Python tracker 

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



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

2021-11-13 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +27800
pull_request: https://github.com/python/cpython/pull/29551

___
Python tracker 

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



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

2021-11-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 25835c518aa7446f3680b62c1fb43827e0f190d9 by Pablo Galindo Salgado 
in branch 'main':
bpo-45738: Fix computation of error location for invalid continuation (GH-29550)
https://github.com/python/cpython/commit/25835c518aa7446f3680b62c1fb43827e0f190d9


--

___
Python tracker 

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



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

2021-11-13 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



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

2021-11-12 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

> I will be able to take a look later in the weekend

Please take some time for yourself, I added you as you were the original author 
of the patch to make you aware. I believe most projects can workaround that for 
now.

--

___
Python tracker 

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



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

2021-11-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +BTaskaya, lys.nikolaou

___
Python tracker 

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



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

2021-11-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I will be able to take a look later in the weekend, so if someone is able to 
give it a go before, that would be great.

--

___
Python tracker 

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



[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 

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



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

2021-11-12 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Note that with the following example, exec and CommandCompiler return a 
different error:

from codeop import CommandCompiler

# identical errors
#exec('1,\\#\n2') SystemError
#CommandCompiler()('1,\\#\n2', symbol='exec') SystemError

# one is syntax the other is System.
exec('a \ \n')  # SyntaxError
CommandCompiler()('a \ \n', symbol='exec') # SystemError

--

___
Python tracker 

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



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

2021-11-12 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Yep, this also break IPython command completions when users press tab in some 
places in multiline code.

88f4ec88e282bf861f0af2d237e9fe28fbc8deac is the first offending commit for me 
in the 3.9 branch:

[3.9] bpo-45494: Fix parser crash when reporting errors involving invalid 
continuation characters (GH-28993) (#29071)

There are two errors that this commit fixes:

* The parser was not correctly computing the offset and the string
  source for E_LINECONT errors due to the incorrect usage of strtok().
* The parser was not correctly unwinding the call stack when a tokenizer
  exception happened in rules involving optionals ('?', [...]) as we
  always make them return valid results by using the comma operator. We
  need to check first if we don't have an error before continuing..
(cherry picked from commit a106343f632a99c8ebb0136fa140cf189b4a6a57)

Co-authored-by: Pablo Galindo Salgado 

NOTE: unlike the cherry-picked original, this commit points at a crazy 
location
due to a bug in the tokenizer that required a big refactor in 3.10 to fix.
We are leaving as-is for 3.9.

--
nosy: +mbussonn

___
Python tracker 

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



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

2021-11-12 Thread Matthias Bussonnier


Change by Matthias Bussonnier :


--
nosy: +pablogsal

___
Python tracker 

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



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

2021-11-11 Thread Zac Hatfield-Dodds


Zac Hatfield-Dodds  added the comment:

It looks like this also affects Python 3.9.8, which makes me very suspicious of 
https://bugs.python.org/issue45494 as the probable cause.

See https://github.com/Zac-HD/hypothesmith/issues/16 and 
https://github.com/psf/black/pull/2592#issuecomment-966745240 for reports.

--
nosy: +Zac Hatfield-Dodds
versions: +Python 3.9

___
Python tracker 

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



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

2021-11-06 Thread PEW's Corner


New submission from PEW's Corner :

When exec'ing code with an illegal character after the line continuation 
character '\', python 3.11.0a2 raises this strange exception:

  SystemError: Negative size passed to PyUnicode_New

Here's an example where '#' is the illegal character:

  exec('1,\\#\n2')

I expected the following exception (which is raised by Python 3.10.0, and also 
by Python 3.11.0a2 when using eval instead of exec, or when the string content 
is put into its own file and run as a normal script):

  SyntaxError: unexpected character after line continuation character

--
messages: 405860
nosy: pewscorner
priority: normal
severity: normal
status: open
title: 3.11 exec raises SystemError instead of SyntaxError on char after line 
continuation
type: behavior
versions: Python 3.11

___
Python tracker 

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