Message406381
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 |
|
Date |
User |
Action |
Args |
2021-11-16 00:47:43 | aroberge | set | recipients:
+ aroberge, lys.nikolaou, pablogsal |
2021-11-16 00:47:43 | aroberge | set | messageid: <1637023663.78.0.877430736208.issue45812@roundup.psfhosted.org> |
2021-11-16 00:47:43 | aroberge | link | issue45812 messages |
2021-11-16 00:47:43 | aroberge | create | |
|