New submission from Andre Roberge <andre.robe...@gmail.com>:

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 in the attached file: the statement is never 
considered to be complete.

===
Python 3.11.0a2 (tags/v3.11.0a2:e2b4e4b, Nov  5 2021, 20:00:05) [MSC v.1929 64 
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 3 \ 4
  File "<stdin>", line 1
    a = 3 \ 4
            ^
SyntaxError: unexpected character after line continuation character
>>> import code
>>> code.interact()
Python 3.11.0a2 (tags/v3.11.0a2:e2b4e4b, Nov  5 2021, 20:00:05) [MSC v.1929 64 
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> a = 3 \ 4
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\andre\AppData\Local\Programs\Python\Python311\lib\code.py", 
line 301, in interact
    console.interact(banner, exitmsg)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\andre\AppData\Local\Programs\Python\Python311\lib\code.py", 
line 232, in interact
    more = self.push(line)
           ^^^^^^^^^^^^^^^
  File "C:\Users\andre\AppData\Local\Programs\Python\Python311\lib\code.py", 
line 258, in push
    more = self.runsource(source, self.filename)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\andre\AppData\Local\Programs\Python\Python311\lib\code.py", 
line 63, in runsource
    code = self.compile(source, filename, symbol)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\andre\AppData\Local\Programs\Python\Python311\lib\codeop.py", 
line 185, in __call__
    return _maybe_compile(self.compiler, source, filename, symbol)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\andre\AppData\Local\Programs\Python\Python311\lib\codeop.py", 
line 96, in _maybe_compile
    code2 = compiler(source + "\n\n", filename, symbol)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\andre\AppData\Local\Programs\Python\Python311\lib\codeop.py", 
line 150, in __call__
    codeob = compile(source, filename, symbol, self.flags, True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: Negative size passed to PyUnicode_New

----------
components: Parser
files: idle_problem.png
messages: 406381
nosy: aroberge, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: SystemError when using code.interact
versions: Python 3.11
Added file: https://bugs.python.org/file50441/idle_problem.png

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45812>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to