Skip to content

Commit

Permalink
fixed UnicodeDecodeError occurring during file name parsing (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
jstucke authored Jun 16, 2023
1 parent 9335a88 commit 7d64dc9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion uefi_firmware/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ def name(self):
@name.setter
def name(self, name):
if isinstance(name, bytes):
name = name.decode("utf-8")
try:
name = name.decode("utf-8")
except UnicodeDecodeError:
name = "0x[{}]".format(name.hex())
self._name = name

@property
Expand Down

0 comments on commit 7d64dc9

Please sign in to comment.