﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24761	Cannot `pip install` the zip of master	Keryn Knight	nobody	"I'm pretty certain I used to be able to do this, though I'm not sure how long ago it was:
{{{
pip install https://github.com/django/django/archive/master.zip
}}}
which is ostensibly the quickest way to get a copy of `master` (currently targetting `1.9.x`) without doing a `git clone`, which takes a bunch of time. It's also the easiest way of setting up continuous integration against `master` (eg: I think one of the ways in which I previously used this was to have travis-ci build using it to check for upcoming failues)

This no longer works, giving the following traceback:
{{{
Exception:
  Traceback (most recent call last):
    File ""lib/python2.7/site-packages/pip/basecommand.py"", line 246, in main
      status = self.run(options, args)
    File ""lib/python2.7/site-packages/pip/commands/install.py"", line 342, in run
      requirement_set.prepare_files(finder)
    File ""lib/python2.7/site-packages/pip/req/req_set.py"", line 345, in prepare_files
      functools.partial(self._prepare_file, finder))
    File ""lib/python2.7/site-packages/pip/req/req_set.py"", line 290, in _walk_req_to_install
      more_reqs = handler(req_to_install)
    File ""lib/python2.7/site-packages/pip/req/req_set.py"", line 487, in _prepare_file
      download_dir, do_download, session=self.session,
    File ""lib/python2.7/site-packages/pip/download.py"", line 827, in unpack_url
      session,
    File ""lib/python2.7/site-packages/pip/download.py"", line 677, in unpack_http_url
      unpack_file(from_path, location, content_type, link)
    File ""lib/python2.7/site-packages/pip/utils/__init__.py"", line 630, in unpack_file
      flatten=not filename.endswith('.whl')
    File ""lib/python2.7/site-packages/pip/utils/__init__.py"", line 510, in unzip_file
      leading = has_leading_dir(zip.namelist()) and flatten
    File ""lib/python2.7/site-packages/pip/utils/__init__.py"", line 224, in has_leading_dir
      prefix, rest = split_leading_dir(path)
    File ""lib/python2.7/site-packages/pip/utils/__init__.py"", line 208, in split_leading_dir
      path = str(path)
  UnicodeEncodeError: 'ascii' codec can't encode character u'\u2297' in position 60: ordinal not in range(128)
}}}
the `path` at the point of error is: 
{{{
path = u'django-master/tests/staticfiles_tests/apps/test/static/test/\u2297.txt'
}}}
I raised a bug against [https://github.com/pypa/pip/issues/2729 pip itself] assuming that the lack of unicode handling was a problem in pip, but a response suggests that there is no safe fix for their end (because of how zip works?) and that Django ought to create & destroy such test files as part of the test case, rather than statically embedded on a known path, which seems sensible enough, if it's feasible in the test cases which touch such files. "	Cleanup/optimization	closed	Packaging	dev	Normal	worksforme		django@…	Unreviewed	0	0	0	0	0	0
