python bots: retry on connection failure