Skip to content

Commit e3c5b86

Browse files
author
rscotty
committed
Fixed UnicodeDecodeError when the registry contains unicode
1 parent 29fbecb commit e3c5b86

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

resources/registry.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import os
66
import xbmc
7+
import io
78
from .util import *
89

910
if os.name == 'nt':
@@ -84,7 +85,7 @@ def get_installed_steam_apps(registry_path):
8485
show_error(e, "Error while reading Windows registry")
8586
pass
8687
else:
87-
with open(registry_path, 'r') as file:
88+
with io.open(registry_path, 'r', encoding="utf-8") as file:
8889
try:
8990
vdf = vdf_parse(file, {})
9091
apps = vdf['registry']['hkcu']['software']['valve']['steam']['apps']

0 commit comments

Comments
 (0)