Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipdb iterating on mutable self.tables.values() #432

Closed
itdaniher opened this issue Oct 24, 2017 · 3 comments
Closed

ipdb iterating on mutable self.tables.values() #432

itdaniher opened this issue Oct 24, 2017 · 3 comments

Comments

@itdaniher
Copy link

Traceback (most recent call last):
  File "test.py", line 38, in <module>
    ipdb_ns.interfaces[wan].add_ip('192.168.1.3/24').up().commit()
  File "/usr/local/lib/python3.5/dist-packages/pyroute2/ipdb/interfaces.py", line 653, in commit
    for record in self.ipdb.routes.filter({'oif': self['index']}):
  File "/usr/local/lib/python3.5/dist-packages/pyroute2/ipdb/routes.py", line 1184, in filter
    for table in self.tables.values():
RuntimeError: dictionary changed size during iteration

pyroute2 0.4.21 / py3.5.2 / ubuntu 16.04

upgraded to git master and haven't reproduced yet, but behavior is somewhat stateful and I don't have a concise test case asof yet.

cheers!

@itdaniher
Copy link
Author

issue is confirmed on

pyroute2==0.4.18.post92

installed via

sudo pip install --upgrade git+https://github.com/svinota/pyroute2.git#master

I still don't have a nice test case as the issue doesn't present itself reliably.

@svinota
Copy link
Owner

svinota commented Oct 26, 2017

Ough. Clearly a bug. Fixing, thanks!

@svinota svinota added the bug label Oct 26, 2017
svinota added a commit that referenced this issue Oct 26, 2017
@svinota
Copy link
Owner

svinota commented Oct 26, 2017

Should be fixed now, thanks for the report!

@svinota svinota closed this as completed Oct 26, 2017
@svinota svinota added the fixed label Oct 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants