mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44: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
|
||||
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue