armbian-next: patching: avoid mangling valid utf-8 from mbox'es
This commit is contained in:
parent
7096cf70d3
commit
a254643268
@ -173,7 +173,13 @@ class PatchFileInDir:
|
||||
patches: list[PatchInPatchFile] = []
|
||||
msg: mailbox.mboxMessage
|
||||
for msg in mbox:
|
||||
patch: str = msg.get_payload()
|
||||
patch: str
|
||||
try:
|
||||
patch = msg.get_payload(decode=True).decode("utf-8")
|
||||
except UnicodeDecodeError as e:
|
||||
log.error(f"Error decoding UTF-8 mbox payload in file {self.full_file_path()}(:{counter}): {e}")
|
||||
patch = msg.get_payload() # this will mangle valid utf-8
|
||||
|
||||
# split the patch itself and the description from the payload
|
||||
desc, patch_contents = self.split_description_and_patch(patch)
|
||||
if len(patch_contents) == 0:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user