UnicodeEncodeError when trying to install file with special symbols

Issue #221 on hold
Daniel Hahler created an issue

Installing Django master fails via tox / pip with an UnicodeEncodeError for a file with a special file name.

The file has been added in https://github.com/django/django/commit/bd059e3f8c6311dcaf8afe5e29ef373f7f84cf26, and the issue is reported for pip at: https://github.com/pypa/pip/issues/1698#issuecomment-75755252.

TEST CASE:

git clone https://github.com/pytest-dev/pytest-django
cd pytest-django
tox -e python2.7-master-sqlite_file

The error is:

GLOB sdist-make: /tmp/pytest-django/setup.py
python2.7-master-sqlite_file create: /tmp/pytest-django/.tox/python2.7-master-sqlite_file
python2.7-master-sqlite_file installdeps: pytest==2.6.4, pytest-xdist==1.11, https://github.com/django/django/archive/master.zip, django-configurations==0.8, south==1.0.2
ERROR: invocation failed (exit code 2), logfile: /tmp/pytest-django/.tox/python2.7-master-sqlite_file/log/python2.7-master-sqlite_file-1.log
ERROR: actionid=python2.7-master-sqlite_file
msg=getenv
cmdargs=[local('/tmp/pytest-django/.tox/python2.7-master-sqlite_file/bin/pip'), 'install', '--pre', 'pytest==2.6.4', 'pytest-xdist==1.11', 'https://github.com/django/django/archive/master.zip', 'django-configurations==0.8', 'south==1.0.2']
env={...}
DEPRECATION: --download-cache has been deprecated and will be removed in the future. Pip now automatically uses and configures its cache.
Collecting https://github.com/django/django/archive/master.zip
  Downloading https://github.com/django/django/archive/master.zip (11.4MB)
  Exception:
  Traceback (most recent call last):
    File "/tmp/pytest-django/.tox/python2.7-master-sqlite_file/lib/python2.7/site-packages/pip/basecommand.py", line 232, in main
      status = self.run(options, args)
    File "/tmp/pytest-django/.tox/python2.7-master-sqlite_file/lib/python2.7/site-packages/pip/commands/install.py", line 339, in run
      requirement_set.prepare_files(finder)
    File "/tmp/pytest-django/.tox/python2.7-master-sqlite_file/lib/python2.7/site-packages/pip/req/req_set.py", line 355, in prepare_files
      do_download, session=self.session,
    File "/tmp/pytest-django/.tox/python2.7-master-sqlite_file/lib/python2.7/site-packages/pip/download.py", line 782, in unpack_url
      session,
    File "/tmp/pytest-django/.tox/python2.7-master-sqlite_file/lib/python2.7/site-packages/pip/download.py", line 671, in unpack_http_url
      unpack_file(from_path, location, content_type, link)
    File "/tmp/pytest-django/.tox/python2.7-master-sqlite_file/lib/python2.7/site-packages/pip/utils/__init__.py", line 648, in unpack_file
      flatten=not filename.endswith('.whl')
    File "/tmp/pytest-django/.tox/python2.7-master-sqlite_file/lib/python2.7/site-packages/pip/utils/__init__.py", line 528, in unzip_file
      leading = has_leading_dir(zip.namelist()) and flatten
    File "/tmp/pytest-django/.tox/python2.7-master-sqlite_file/lib/python2.7/site-packages/pip/utils/__init__.py", line 253, in has_leading_dir
      prefix, rest = split_leading_dir(path)
    File "/tmp/pytest-django/.tox/python2.7-master-sqlite_file/lib/python2.7/site-packages/pip/utils/__init__.py", line 237, in split_leading_dir
      path = str(path)
  UnicodeEncodeError: 'ascii' codec can't encode character u'\u2297' in position 60: ordinal not in range(128)


ERROR: could not install deps [pytest==2.6.4, pytest-xdist==1.11, https://github.com/django/django/archive/master.zip, django-configurations==0.8, south==1.0.2]; v = InvocationError('/tmp/pytest-django/.tox/python2.7-master-sqlite_file/bin/pip install --pre pytest==2.6.4 pytest-xdist==1.11 https://github.com/django/django/archive/master.zip django-configurations==0.8 south==1.0.2 (see /tmp/pytest-django/.tox/python2.7-master-sqlite_file/log/python2.7-master-sqlite_file-1.log)', 2)
__________________________________________________________ summary ___________________________________________________________
ERROR:   python2.7-master-sqlite_file: could not install deps [pytest==2.6.4, pytest-xdist==1.11, https://github.com/django/django/archive/master.zip, django-configurations==0.8, south==1.0.2]; v = InvocationError('/tmp/pytest-django/.tox/python2.7-master-sqlite_file/bin/pip install --pre pytest==2.6.4 pytest-xdist==1.11 https://github.com/django/django/archive/master.zip django-configurations==0.8 south==1.0.2 (see /tmp/pytest-django/.tox/python2.7-master-sqlite_file/log/python2.7-master-sqlite_file-1.log)', 2)

Comments (3)

  1. Log in to comment