Fix a logging regression on Python 2 involving unicode strings.