Commit eb721baa authored by Christian Heimes's avatar Christian Heimes

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

parent 8bf888b5
...@@ -93,10 +93,10 @@ def read_values(base, key): ...@@ -93,10 +93,10 @@ def read_values(base, key):
return d return d
def convert_mbcs(s): def convert_mbcs(s):
enc = getattr(s, "encode", None) dec = getattr(s, "decode", None)
if enc is not None: if dec is not None:
try: try:
s = enc("mbcs") s = dec("mbcs")
except UnicodeError: except UnicodeError:
pass pass
return s 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