[Django] #24761: Cannot `pip install` the zip of master

6 views
Skip to first unread message

Django

unread,
May 7, 2015, 3:23:20 AM5/7/15
to django-...@googlegroups.com
#24761: Cannot `pip install` the zip of master
--------------------------------------+--------------------
Reporter: kezabelle | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Packaging | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/24761>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 7, 2015, 6:15:43 AM5/7/15
to django-...@googlegroups.com
#24761: Cannot `pip install` the zip of master
-------------------------------------+-------------------------------------
Reporter: kezabelle | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Packaging | Version: master
Severity: Normal | Resolution:
| worksforme
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by jezdez):

* 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>

Django

unread,
May 7, 2015, 6:26:54 AM5/7/15
to django-...@googlegroups.com
#24761: Cannot `pip install` the zip of master
-------------------------------------+-------------------------------------
Reporter: kezabelle | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Packaging | Version: master
Severity: Normal | Resolution:
| worksforme
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
May 7, 2015, 8:33:19 AM5/7/15
to django-...@googlegroups.com
#24761: Cannot `pip install` the zip of master
-------------------------------------+-------------------------------------
Reporter: kezabelle | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Packaging | Version: master
Severity: Normal | Resolution:
| worksforme
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Reply all
Reply to author
Forward
0 new messages