Message387173
Attached func_builtins2.py mimicks the cloudpicke bug:
---
def func(s): return len(s)
code = func.__code__
FuncType = type(func)
func2_globals = {}
func2 = FuncType(code, func2_globals)
# func2.func_builtins = {'None': None}
func2.__globals__['__builtins__'] = __builtins__
# frame created with {'None': None} builtins: "len" key is missing
func2("abc")
---
In Python 3.10, setting func2.__globals__['__builtins__'] has no longer an impact on the frame created to call func2(). |
|
Date |
User |
Action |
Args |
2021-02-17 17:46:14 | vstinner | set | recipients:
+ vstinner, Mark.Shannon, frenzy, pablogsal |
2021-02-17 17:46:14 | vstinner | set | messageid: <1613583974.86.0.85493733983.issue43228@roundup.psfhosted.org> |
2021-02-17 17:46:14 | vstinner | link | issue43228 messages |
2021-02-17 17:46:14 | vstinner | create | |
|