[issue12609] SystemError: Objects/codeobject.c:64: bad argument to internal function

Albert Zeyer report at bugs.python.org
Fri Jul 22 15:52:29 CEST 2011


Albert Zeyer <albzey at googlemail.com> added the comment:

Simplified code:

```
from ast import *

globalsDict = {}

exprAst = Interactive(body=[
	FunctionDef(
		name=u'foo',
		args=arguments(args=[], vararg=None, kwarg=None, defaults=[]),
		body=[Pass()],
		decorator_list=[])])

fix_missing_locations(exprAst)
compiled = compile(exprAst, "<foo>", "single")
eval(compiled, {}, globalsDict)

f = globalsDict["foo"]
print(f)
```

If I change `name=u'foo'` to `name='foo'`, it works.

----------

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


More information about the Python-bugs-list mailing list