Commit ee4bf04
Handle non-UTF-8 device models
Took me a while to figure out why Fedora 40 installer was dying on me
on a Wyse 3040 thin client and I finally narrowed it down to pyparted
and found the associated issue (linked).
The fix proposed in the issue comments worked for me so I figured I'd
send a PR.
Before:
>>> import parted
>>> parted.getDevice('/dev/mmcblk0').model
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/root/pyparted/build/lib.linux-x86_64-cpython-312/parted/device.py", line 69, in model
return self.__device.model
^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 9: invalid start byte
After:
>>> import parted
>>> parted.getDevice('/dev/mmcblk0').model
'MMC H8G4a�'
Resolves: #761 parent d5870bb commit ee4bf04
1 file changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
260 | 268 | | |
261 | 269 | | |
262 | 270 | | |
| |||
0 commit comments