Ensure `before_sleep_log` message isn't multiline
Some exceptions add extra \n characters to their message, causing the last . in the log to be a new line.
⚠️ No release notes detected. Please make sure to use reno to add a changelog entry.
I'm failing to see how this is a problem in tenacity itself and not in the so called exception though
@jd the PR's title might be a bit overreaching, since it won't solve actual multiline string representations (i.e., if the exception has \n "in between"). However, since the tenacity log adds a. `` at the end, I think the expectation (when implemented) was that it would come immediately after the exception string, which might not be the case if it ends with \n.
I do agree that the actual problem is more probably in the exception, but tenacity logs end up split across multiple lines. I thought about implementing my own before_sleep_log, but since it uses a private function, I desisted.
Right; I'd rather change the log line to not have a final . but using something like {verb}: {e}