Premature call to OccupiedPorts.unclaim( )
If I set a breakpoint in my code, then give the 'c' command, execution proceeds to my breakpoint and stops as expected. Behind the scenes, rpdb internally calls OccupiedPorts.unclaim( ) which deletes the port reference from the self.claims dictionary.
When I then give the 'c' command to continue execution after the breakpoint and my code runs to completion, rpdb again calls OccupiedPorts.unclaim( ), resulting in a KeyError exception, since the port entry was already deleted.
I think the real bug is in Rpdb.d_continue( ), since it calls self.shutdown( ), which in turn calls OCCUPIED.unclaim( ).
Calling shutdown sort of makes sense. When you continue, you're exiting pdb and letting Python continue as normal. The problem for us is that we don't want to drop the connection, otherwise we have to keep quitting telnet and reconnecting every time we do a continue. I'm not sure what the solution is to this but I'll keep thinking.