[issue11441] compile() raises SystemError if called from except clause

July Tikhonov report at bugs.python.org
Tue Mar 8 17:24:44 CET 2011


New submission from July Tikhonov <july.tikh at gmail.com>:

Normal:
>>> compile('1 = 1', '<string>', 'exec')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1
SyntaxError: can't assign to literal

SystemError is raised instead of SyntaxError:
>>> try: abcde
... except NameError:
...  compile('1 = 1', '<string>', 'exec')
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'abcde' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
SystemError: Objects/tupleobject.c:126: bad argument to internal function

Error can be discovered by calling dis.dis('1 = 1').

----------
components: Library (Lib)
messages: 130342
nosy: july
priority: normal
severity: normal
status: open
title: compile() raises SystemError if called from except clause
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11441>
_______________________________________


More information about the Python-bugs-list mailing list