From: Christian Heimes Date: Sat, 17 Nov 2007 11:46:54 +0000 (+0000) Subject: The _winreg module returns bytes which must be decoded to unicode, not encoded. X-Git-Tag: v3.0a2~162 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d157e6977784c9483bdffc5d8ccd108c3cd4f94f;p=thirdparty%2FPython%2Fcpython.git The _winreg module returns bytes which must be decoded to unicode, not encoded. --- diff --git a/Lib/distutils/msvccompiler.py b/Lib/distutils/msvccompiler.py index d239057bac40..6bf969f9d23e 100644 --- a/Lib/distutils/msvccompiler.py +++ b/Lib/distutils/msvccompiler.py @@ -93,10 +93,10 @@ def read_values(base, key): return d def convert_mbcs(s): - enc = getattr(s, "encode", None) - if enc is not None: + dec = getattr(s, "decode", None) + if dec is not None: try: - s = enc("mbcs") + s = dec("mbcs") except UnicodeError: pass return s