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.

classification
Title: Fatal Python error: non-string found in code slot
Type: Stage:
Components: Versions: Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: SystemError: Objects/codeobject.c:64: bad argument to internal function
View: 12609
Assigned To: Nosy List: Albert.Zeyer, benjamin.peterson
Priority: normal Keywords:

Created on 2011-07-22 13:49 by Albert.Zeyer, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (1)
msg140877 - (view) Author: Albert Zeyer (Albert.Zeyer) * Date: 2011-07-22 13:49
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
2022-04-11 14:57:20adminsetgithub: 56819
2011-07-22 16:09:50benjamin.petersonsetstatus: open -> closed
resolution: duplicate
superseder: SystemError: Objects/codeobject.c:64: bad argument to internal function
2011-07-22 15:02:43pitrousetnosy: + benjamin.peterson
2011-07-22 13:49:49Albert.Zeyercreate