logilab-common #270922 get_cycles is broken on Python3 [rejected]
graph.get_cycles is broken in the latest logilab.common, see for instance the following traceback. Wrapping graph_dict.keys() in a list should do it. File "/home/ubuntu/src/bitbucket.org/logilab/pylint/.tox/py33/lib/python3.3/site-packages/pylint/test/unittest_lint.py", line 361, in test_lint_ext_module_with_file_output self.linter.check(strio) File "/home/ubuntu/src/bitbucket.org/logilab/pylint/.tox/py33/lib/python3.3/site-packages/pylint/lint.py", line 639, in check self._do_check(files_or_modules) File "/home/ubuntu/src/bitbucket.org/logilab/pylint/.tox/py33/lib/python3.3/site-packages/pylint/lint.py", line 774, in _do_check checker.close() File "/home/ubuntu/src/bitbucket.org/logilab/pylint/.tox/py33/lib/python3.3/site-packages/pylint/checkers/imports.py", line 240, in close for cycle in get_cycles(self.import_graph): File "/home/ubuntu/src/bitbucket.org/logilab/pylint/.tox/py33/lib/python3.3/site-packages/logilab/common/graph.py", line 234, in get_cycles for vertice in vertices: RuntimeError: dictionary changed size during iteration This is pretty important, because it makes Pylint unusable on Python 3 (at least the imports checker, which uses get_cycles). | |
priority | important |
---|---|
type | bug |
done in | <not specified> |
load | 0.000 |
load left | 0.000 |
closed by | <not specified> |
Comments
-
2014/11/07 10:56, written by sthenault
-
2014/11/10 10:15, written by jcristau
-
2014/11/13 13:53, written by pcmanticore@gmail.com
-
2014/11/19 09:25, written by sthenault
add commentreading the code, it's still unclear to me where the graph dictionnary is being modified
how can I reproduce this? running test_lint_ext_module_with_file_output on python3.4 seems to work for me...
jcristau, it reproduces all the time for me, running Pylint's test suite. Sylvain, it wasn't clear where the dictionary was modified, due to the fact that the used dictionary was a defaultdict, so a simple key access would have been enough. Here's a small snippet reproducing the problem: https://gist.github.com/PCManticore/260db4d7bafe644f306e.
FYI this has been fixed on the pylint side and this may be enough, imo