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.
--
Ticket URL: <https://code.djangoproject.com/ticket/24761>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_docs: => 0
* resolution: => worksforme
* needs_tests: => 0
* needs_better_patch: => 0
Comment:
You can use the gzip'ed tarball that doesn't have the underlying problem
while it's being fixed in pip:
{{{
pip install https://github.com/django/django/archive/master.tar.gz
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24761#comment:1>
Comment (by kezabelle):
Based on the response on pip's ticket, it remains to be seen whether it
'''can''' be fixed correctly. Additionally when I originally posited the
question in `#pypa-dev`, the response given was that it was likely
intentional that it only handle ASCII paths.
Final addendum: if the zip is no longer a ''"safe"'' choice (across tools,
O/Ses, locales, whatever) then the
[https://www.djangoproject.com/download/ download page] probably ought to
stop linking to the zipball.
--
Ticket URL: <https://code.djangoproject.com/ticket/24761#comment:2>
Comment (by timgraham):
[https://github.com/django/djangoproject.com/pull/465 PR] to update the
download page.
--
Ticket URL: <https://code.djangoproject.com/ticket/24761#comment:3>