Mockbox
Mockbox copied to clipboard
WebSocket onclose() in python sometimes gets called twice
If you take out the try
/catch
at https://github.com/jkingsman/Mockbox/blob/master/Web.py#L77, it appears that the connection list removal happens twice (and triggers an exception when you try to remove an element that doesn't exist). The try
/catch
is kludgy and a Bad Thing™; it's really just a band aid - what's more puzzling is why a terminal event listener is getting called more than once on the same object... What is Python thinking?
How is it feeling?
What have we done to each other?
What will we do?
Dunno what it was, but it looks like migrating to a keyed dictionary on adea7d6 fixed the issue.
Nevermind... just got lucky a few times. Bugs still exist. MAN THIS WOULD BE SO MUCH EASIER TO DEBUG IF THE CREATOR HAD WRITTEN A TEST SUITE WITH THIS. Oh. wait.
nvm.