You are absolutely right. BaseException is too broad. I'm going to change it to socket.error.