Fix error on non ASCII PCI IDs upon qvm-device list

solves https://github.com/QubesOS/qubes-issues/issues/4229
This commit is contained in:
Galland 2018-08-21 03:08:17 +02:00 committed by GitHub
parent fbdf460db8
commit 6f04c8d65b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,7 +42,7 @@ def load_pci_classes():
# subclass subclass_name <-- single tab
# prog-if prog-if_name <-- two tabs
result = {}
with open('/usr/share/hwdata/pci.ids') as pciids:
with open('/usr/share/hwdata/pci.ids', encoding='utf-8', errors='ignore') as pciids:
class_id = None
subclass_id = None
for line in pciids.readlines():