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 vstinner
Recipients Mark.Shannon, frenzy, pablogsal, vstinner
Date 2021-02-17.17:46:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1613583974.86.0.85493733983.issue43228@roundup.psfhosted.org>
In-reply-to
Content
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().
History
Date User Action Args
2021-02-17 17:46:14vstinnersetrecipients: + vstinner, Mark.Shannon, frenzy, pablogsal
2021-02-17 17:46:14vstinnersetmessageid: <1613583974.86.0.85493733983.issue43228@roundup.psfhosted.org>
2021-02-17 17:46:14vstinnerlinkissue43228 messages
2021-02-17 17:46:14vstinnercreate