Skip to content

Commit

Permalink
Fixed issue where UTF-8 characters in script metadata broke anonymiza…
Browse files Browse the repository at this point in the history
…tion and incremental build
  • Loading branch information
fireundubh committed Apr 25, 2022
1 parent 0a56085 commit 6c2fd5d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyro/PexHeader.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ def read(self, f: IO, name: str, length: int) -> None:
if isinstance(obj, PexInt):
obj.value = int.from_bytes(obj.data, self.endianness, signed=False)
elif isinstance(obj, PexStr):
obj.value = obj.data.decode('ascii')
try:
obj.value = obj.data.decode('ascii')
except UnicodeDecodeError:
obj.value = obj.data.decode('utf-8')

0 comments on commit 6c2fd5d

Please sign in to comment.