Commit 1b8dc8c7 authored by Jason R. Coombs's avatar Jason R. Coombs

Fix UnicodeDecodeError when tarfile names have non-ascii characters. Fixes #709.

parent 96159fc8
......@@ -143,6 +143,8 @@ def unpack_tarfile(filename, extract_dir, progress_filter=default_filter):
tarobj.chown = lambda *args: None
for member in tarobj:
name = member.name
if isinstance(name, bytes):
name = name.decode(tarfile.ENCODING)
# don't extract absolute paths or ones with .. in them
if not name.startswith('/') and '..' not in name.split('/'):
prelim_dst = os.path.join(extract_dir, *name.split('/'))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment