aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/archive_util.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-08-01 22:30:09 -0400
committerJason R. Coombs <jaraco@jaraco.com>2016-08-01 22:30:09 -0400
commit1b8dc8c7ac45662f7719b1bd531d0575e7fb1f02 (patch)
tree7a9bed2fa2feb7f5696c292a14f9e6f0ca90b8d5 /setuptools/archive_util.py
parent96159fc86c3ae19afe63e4699430f600c407f4d3 (diff)
downloadexternal_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-xsetuptools/archive_util.py2
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('/'))