New submission from PEW's Corner <pewscor...@gmail.com>:

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 <rep...@bugs.python.org>
<https://bugs.python.org/issue45738>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to