Skip to content
Snippets Groups Projects
Commit 9a0faeed authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Use "surrogateescape" mechanism to avoid a UnicodeDecodeError and crash when...

Use "surrogateescape" mechanism to avoid a UnicodeDecodeError and crash when decoding zipinfo output that is not UTF-8 compliant. (Closes: Debian:#1093484)

Although the line in question pertains to strippings paths, we were decoding all lines that don't start with "Archive:".
parent 72df2175
No related branches found
No related tags found
No related merge requests found
Pipeline #801601 passed with warnings
......@@ -54,7 +54,7 @@ class Zipinfo(Command):
# Strip paths from errors and warnings
# eg: "warning [/full/path]: 472 extra bytes at beginning or within zipfile"
m = self.re_strip_path.match(line.decode("utf-8"))
m = self.re_strip_path.match(line.decode("utf-8", "surrogateescape"))
if m is not None:
return "{}: {}\n".format(m.group(1), m.group(2)).encode("utf-8")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment