Traceback (most recent call last):
File "/home/brian/Projects/open-contrib/cpython/temp.py", line 27, in <module>
_interpreters.set___main___attrs(i, types.MappingProxyType({"a": 1}))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: Objects/dictobject.c:4162: bad argument to internal function
Bug report
Bug description:
This snippet:
raises:
This happens during this call to
_PyXI_Enterwhich callsPyDict_Sizeonupdates.The public interface always passes a
dict, and other paths that call_PyXI_Entercheck for an actual dict (e.g.,exec). I think it makes sense to do the same thing here. PR forthcoming.CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
SystemErrorwhen passing non-dict object to_interpreters.set___main___attrs#135856_interpreters.set___main___attrs(gh-135856) #135900_interpreters.set___main___attrs(gh-135856) #135903