mirror of
https://gitlab.com/ita1024/waf.git
synced 2025-01-20 23:40:21 +01:00
Decode vswhere output as utf8/replace when cp1252 fails
This commit is contained in:
parent
17cd653136
commit
c668663362
@ -457,7 +457,10 @@ def gather_vswhere_versions(conf, versions):
|
|||||||
return
|
return
|
||||||
|
|
||||||
if sys.version_info[0] < 3:
|
if sys.version_info[0] < 3:
|
||||||
txt = txt.decode(sys.stdout.encoding or 'windows-1252')
|
try:
|
||||||
|
txt = txt.decode(sys.stdout.encoding or 'cp1252')
|
||||||
|
except UnicodeError:
|
||||||
|
txt = txt.decode('utf-8', 'replace')
|
||||||
arr = json.loads(txt)
|
arr = json.loads(txt)
|
||||||
arr.sort(key=lambda x: x['installationVersion'])
|
arr.sort(key=lambda x: x['installationVersion'])
|
||||||
for entry in arr:
|
for entry in arr:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user