diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2016-08-01 22:30:09 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-08-01 22:30:09 -0400 |
commit | 1b8dc8c7ac45662f7719b1bd531d0575e7fb1f02 (patch) | |
tree | 7a9bed2fa2feb7f5696c292a14f9e6f0ca90b8d5 /setuptools/archive_util.py | |
parent | 96159fc86c3ae19afe63e4699430f600c407f4d3 (diff) | |
download | external_python_setuptools-1b8dc8c7ac45662f7719b1bd531d0575e7fb1f02.tar.gz external_python_setuptools-1b8dc8c7ac45662f7719b1bd531d0575e7fb1f02.tar.bz2 external_python_setuptools-1b8dc8c7ac45662f7719b1bd531d0575e7fb1f02.zip |
Fix UnicodeDecodeError when tarfile names have non-ascii characters. Fixes #709.
Diffstat (limited to 'setuptools/archive_util.py')
-rwxr-xr-x | setuptools/archive_util.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/setuptools/archive_util.py b/setuptools/archive_util.py index b6411cc5..a1960be8 100755 --- a/setuptools/archive_util.py +++ b/setuptools/archive_util.py @@ -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('/')) |