diff --git a/waflib/Logs.py b/waflib/Logs.py index 11dc34f3..298411db 100644 --- a/waflib/Logs.py +++ b/waflib/Logs.py @@ -237,7 +237,10 @@ class formatter(logging.Formatter): if rec.levelno >= logging.INFO: # the goal of this is to format without the leading "Logs, hour" prefix if rec.args: - return msg % rec.args + try: + return msg % rec.args + except UnicodeDecodeError: + return msg.encode('utf-8') % rec.args return msg rec.msg = msg diff --git a/waflib/Utils.py b/waflib/Utils.py index 4b808a85..0a069b12 100644 --- a/waflib/Utils.py +++ b/waflib/Utils.py @@ -604,6 +604,12 @@ def h_list(lst): """ return md5(repr(lst).encode()).digest() +if sys.hexversion < 0x3000000: + def h_list_python2(lst): + return md5(repr(lst)).digest() + h_list_python2.__doc__ = h_list.__doc__ + h_list = h_list_python2 + def h_fun(fun): """ Hash functions