Commit 7fba7d60 authored by Christian Heimes's avatar Christian Heimes

The _winreg module returns bytes which must be decoded to unicode, not encoded.

parent d5934870
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment