-
Notifications
You must be signed in to change notification settings - Fork 91
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
RuntimeError: dictionary changed size during iteration #338
Comments
Thanks for the report! |
Here is the public gist for the code of my test file: https://gist.github.com/Kostanos/736dddbc36d226962c3c43a7f95416d3#file-__init___test-py-L81 I'm running it on I found the similar issues in other projects with python 3.x: https://stackoverflow.com/a/11941855/2215679 Let me know if you need more info. |
I still don't get it... The problem usually occurs, if the iterated dictionary is changed during iteration. This seems not to happen here, though there must be some side effect that leads to this in your case... import unittest
from pyfakefs import fake_filesystem_unittest
class TestSettings(fake_filesystem_unittest.TestCase):
def setUp(self):
self.setUpPyfakefs()
def testDefaultSettings(self):
pass
if __name__ == '__main__':
unittest.main() |
@Kostanos - any news there? |
@Kostanos - if you still have the problem, please test with the newly released version 3.4. |
Hi, sorry, already on completely different project. Thank you. |
Can we close this then, as we have no real chance to get this figured out? |
Suspend issue until we can test it again |
Ok, feel free to reopen it any time you get back to it. Thanks for the report! |
I'm still experiencing this or a similar problem. As a temporary workaround in
|
Ok, reopening in this case. |
It's probably unrelated but how does |
Hm, looks some kind of weird side effect with a specific module - probably your change is the best fix in this case. Out of interest - can you check which module it is choking on (e.g. by adding some print output to |
Adding a print output in |
Well - the last printed one should be the one (given that you run only the failing test), but that's not that important anyway - just a matter of interest. |
Alright, suit yourself then.
|
Ok, don't have the time today, will have another look tomorrow. |
BTW, I checked that log file, and the last entry is |
Who knew. The xonsh developers are usually very active, friendly and helpful. If one of us tells them of this issue, I suspect they'll be very quick to fix it. Given it's a flaw in their code. |
Probably it's just unusual code, not a bug - and with your fix (e.g. copying the dict) we can handle this. I don't think the performance penalty is worth considering, but I'll check it. |
Ok, couldn't reproduce the problem under Windows with xonsh installed, but then I didn't really expect that - just wanted to play around with xonsh ;) |
Same issue here, It is not always giving error. I couldn't understand where it results from. I read all the thread and upgraded my pyfakefs==4.1.0 that is the most recent one. OS is linux or mac, it doesn't matter.
|
@hasansalimkanmaz - can you please check with current master? I added more robust error handling recently, but this is not yet released. |
@mrbean-bremen - It works with master branch. Thanks for the info. |
Ok, thanks - will close this again. If needed we can make a patch release soon. |
Running test on python 3.6 with
pyfakefs==3.3
and got this error:In previous python version it worked well.
The text was updated successfully, but these errors were encountered: