This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Albert.Zeyer
Recipients Albert.Zeyer
Date 2011-07-22.13:49:49
SpamBayes Score 0.00030564205
Marked as misclassified No
Message-id <1311342590.28.0.333956728566.issue12610@psf.upfronthosting.co.za>
In-reply-to
Content
Code:

```
from ast import *

globalsDict = {}

body = [
	Assign(targets=[Name(id=u'argc', ctx=Store())],
		   value=Name(id=u'None', ctx=Load())),
	]

exprAst = Interactive(body=[
	FunctionDef(
		name='foo',
		args=arguments(args=[Name(id=u'argc', ctx=Param()), Name(id=u'argv', ctx=Param())],
					   vararg=None, kwarg=None, defaults=[]),
		body=body,
		decorator_list=[])])

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

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

CPython 2.7.1: Fatal Python error: non-string found in code slot
PyPy 1.5: <function foo at 0x0000000103114430>
History
Date User Action Args
2011-07-22 13:49:50Albert.Zeyersetrecipients: + Albert.Zeyer
2011-07-22 13:49:50Albert.Zeyersetmessageid: <1311342590.28.0.333956728566.issue12610@psf.upfronthosting.co.za>
2011-07-22 13:49:49Albert.Zeyerlinkissue12610 messages
2011-07-22 13:49:49Albert.Zeyercreate