This is a part of traceback I've got. And I have no idea how is it possible.
There is no multi-threading (I think). But even if there is a thread which is changing gloabls()
is it possible to change globals()
during list creation? I thought list()
call is protected with GIL, isn't it?
I reproduced it twice, but now I can't reproduce it.
Do you have any ideas how is it possible?
Source code: https://github.com/python/cpython/blob/3.5/Lib/lib2to3/pgen2/token.py#L73
Python 3.5.2, CentOS Linux release 7.4.1708
from past.builtins import basestring
File "/home/user/app/lib64/python3.5/site-packages/past/__init__.py", line 88, in <module>
from past.translation import install_hooks as autotranslate
File "/home/user/app/lib64/python3.5/site-packages/past/translation/__init__.py", line 41, in <module>
from lib2to3.pgen2.parse import ParseError
File "/usr/lib64/python3.5/lib2to3/pgen2/parse.py", line 14, in <module>
from . import token
File "/usr/lib64/python3.5/lib2to3/pgen2/token.py", line 73, in <module>
for _name, _value in list(globals().items()):
RuntimeError: dictionary changed size during iteration