]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
hwdb/ids_parser: use replacement chars for invalid characters
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 14 Dec 2017 14:42:25 +0000 (15:42 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 14 Dec 2017 14:47:39 +0000 (15:47 +0100)
We have some more non-utf8 characters. Let's just replace them, this doesn't
matter much.

hwdb/ids_parser.py

index 3c43649fc17766c9bae7cc84ee45c39b6be21e9a..c80d22258a35fd675368a9a3b18754c668ec5a49 100755 (executable)
@@ -344,17 +344,17 @@ if __name__ == '__main__':
     args = sys.argv[1:]
 
     if not args or 'usb' in args:
-        p = usb_ids_grammar().parseFile(open('usb.ids'))
+        p = usb_ids_grammar().parseFile(open('usb.ids', errors='replace'))
         usb_vendor_model(p)
         usb_classes(p)
 
     if not args or 'pci' in args:
-        p = pci_ids_grammar().parseFile(open('pci.ids'))
+        p = pci_ids_grammar().parseFile(open('pci.ids', errors='replace'))
         pci_vendor_model(p)
         pci_classes(p)
 
     if not args or 'sdio' in args:
-        p = pci_ids_grammar().parseFile(open('sdio.ids'))
+        p = pci_ids_grammar().parseFile(open('sdio.ids', errors='replace'))
         sdio_vendor_model(p)
         sdio_classes(p)