joelspadin / pyvswhere

Python interface to Microsoft's Visual Studio locator tool, vswhere
MIT License
10 stars 2 forks source link

UnicodeDecodeError on german install #5

Open terrorfisch opened 2 years ago

terrorfisch commented 2 years ago

The return value of check_output in execute

subprocess.check_output(args).decode('utf-8')

contains

b'"description": "Leistungsstarke IDE, kostenlos f\x81r Studenten, Open-Source-Mitwirkende und Einzelpersonen"'

which looks like ü latin1 encoding to me and raises an UnicodeDecodeError on decoding. This seems to be a bug in vswhere itself but I am unsure if the -utf8 flag guarantees pure utf8 output.

python=3.8.13
pyvswhere=1.4.0
vswhere=3.0.1+e2e4e03c65
args=['C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe', '-utf8', '-latest', '-products', '*', '-requires', 'Microsoft.Component.MSBuild', '-format', 'json']
Sil3ntStorm commented 2 years ago

Seems like this might have been fixed upstream. Using a newer vswhere.exe should work.