Tell shutil.make_archive to use Unicode paths
By default, make_archive uses str paths on Python 2, which causes it to
skip files with unencodable names. By passing in a unicode base_dir
explicitly, it is smart enough to use unicode all the way down instead.
@@ -15,7 +15,7 @@ from textwrap import dedent
from zipfile import ZipFile
import pytest
-from pip._vendor.six import PY2, ensure_binary
+from pip._vendor.six import PY2, ensure_binary, text_type
from scripttest import FoundDir, TestFileEnvironment
from pip._internal.index.collector import LinkCollector
@@ -1053,7 +1053,12 @@ def create_basic_wheel_for_package(
path.write_bytes(ensure_binary(files[fname]))
retval = script.scratch_path / archive_name
- generated = shutil.make_archive(retval, 'zip', script.temp_path)
+ generated = shutil.make_archive(
+ retval,
+ 'zip',
+ root_dir=script.temp_path,
+ base_dir=text_type(os.curdir),
+ )
shutil.move(generated, retval)
shutil.rmtree(script.temp_path)
