SystemError while execing bad code

Gerrit Holl gerrit at nl.linux.org
Tue Jan 20 06:52:25 EST 2004


Hi,

I found a cool way to trigger a SystemError:

>>> exec CodeType(0,0,0,0,"",(),(),(),"","",0,"")
XXX lineno: 0, opcode: 0
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.2/site-packages/", line 0, in
    File "/usr/lib/python2.2/site-packages/", line 0, in
SystemError: unknown opcode

The documentation says:
You should report this to the author or maintainer of your Python
interpreter. Be sure to report the version of the Python interpreter
(sys.version; it is also printed at the start of an interactive Python
session), the exact error message (the exception's associated value) and
if possible the source of the program that triggered the error.

Although it probably shouldn't be taken literally in this case...
...or should it :-)?

Hmm, and this actually *hangs*:
>>> exec CodeType(0,0,0,0,"",(),(),(),"","",2**31-1,"")
XXX lineno: 2147483647, opcode: 0
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.2/site-packages/", line 2147483647, in

...

But I guess this is a case of "so don't do it" :-)?

yours,
Gerrit.

-- 
263. If he kill the cattle or sheep that were given to him, he shall
compensate the owner with cattle for cattle and sheep for sheep.
          -- 1780 BC, Hammurabi, Code of Law
-- 
PrePEP: Builtin path type
    http://people.nl.linux.org/~gerrit/creaties/path/pep-xxxx.html
Asperger's Syndrome - a personal approach:
	http://people.nl.linux.org/~gerrit/english/




More information about the Python-list mailing list