mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
The _winreg module returns bytes which must be decoded to unicode, not encoded.
This commit is contained in:
parent
ad14d11a5e
commit
d157e69777
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue