This block doesn't need to be part of the enclosing timeout block, which should strictly be timing whether the spawned commanded succeeded in time.  This is part of the previous request to factor out the JSON-specific logic.  This routine is really independent of Python and JSON, so the variable names should reflect that.