You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -106,20 +106,22 @@ UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 97850: ordi
106
106
3.7:
107
107
```
108
108
109
-
This error means that the `'ascii' codec` cannot handle inputord() >=128, andas some Video cards use `²` to reference their power, the `ascii` codec chokes on them.
110
-
111
-
It means `xcp.pci.PCIIds()` cannot use `open("/usr/share/hwdata/pci.ids").read()`.
109
+
The `'ascii'` codec fails on allbytes>128.
110
+
For example, it fails the bytes of `²` (UTF-8: power of two) in the PCI IDs database.
111
+
To read `/usr/share/hwdata/pci.ids`, we must use `encoding="utf-8"`.
112
112
113
113
While Python 3.7and newer use UTF-8 mode by default, it does notset up an error handler for`UnicodeDecodeError`.
114
114
115
-
As it happens, some older tools output ISO-8859-1 characters hard-coded and these aren't valid UTF-8 sequences, and even newer Python versions need error handlers to not fail:
115
+
Also, some older tools output ISO-8859-1 characters
116
+
These aren't valid UTF-8 sequences.
117
+
For all Python versions, we need to use error handlers to handle them:
0 commit comments