[Python-Dev] known obvious thing or bug (rexec)?

Samuele Pedroni pedronis@bluewin.ch
Sat, 14 Dec 2002 16:29:27 +0100


latest CVS

Python 2.3a0 (#1, Dec 14 2002, 07:19:32)
[GCC 2.95.2 20000220 (Debian GNU/Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

consider

>>> import rexec
>>> r=rexec.RExec()
>>> r.r_exec("class C: pass\nC.a=0")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/home/users/p/pe/pedronis/python/dist/src/Lib/rexec.py", line 309, in
r_
exec
    exec code in m.__dict__
  File "<string>", line 2, in ?
RuntimeError: classes are read-only in restricted mode

vs.

>>> r.r_exec("class C(object): pass\nC.a=0")
>>>

regards