New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(patch) correctly catch exception for pip on python3.1, 3.2 #314

Closed
hpk42 opened this Issue Jul 7, 2011 · 0 comments

Comments

Projects
None yet
2 participants
@hpk42

hpk42 commented Jul 7, 2011

i usually get errors with pip on python3 because my PyPI server does not serve a content-length (i think). Errors look like this:

[TOX] ERROR: /home/ci/workspace/pytest-xdist/TOXENV/py31/label/linux/.tox/py31/log$ ../bin/pip install -i http://pypi.testrun.org --download-cache=/home/ci/workspace/pytest-xdist/TOXENV/py31/label/linux/.tox/_download pytest >1.log
Downloading/unpacking pytest
Exception:
Traceback (most recent call last):
File "/home/ci/workspace/pytest-xdist/TOXENV/py31/label/linux/.tox/py31/lib/python3.1/site-packages/pip-1.0.1-py3.1.egg/pip/basecommand.py", line 126, in main
self.run(options, args)
File "/home/ci/workspace/pytest-xdist/TOXENV/py31/label/linux/.tox/py31/lib/python3.1/site-packages/pip-1.0.1-py3.1.egg/pip/commands/install.py", line 223, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/home/ci/workspace/pytest-xdist/TOXENV/py31/label/linux/.tox/py31/lib/python3.1/site-packages/pip-1.0.1-py3.1.egg/pip/req.py", line 961, in prepare_files
self.unpack_url(url, location, self.is_download)
File "/home/ci/workspace/pytest-xdist/TOXENV/py31/label/linux/.tox/py31/lib/python3.1/site-packages/pip-1.0.1-py3.1.egg/pip/req.py", line 1079, in unpack_url
return unpack_http_url(link, location, self.download_cache, only_download)
File "/home/ci/workspace/pytest-xdist/TOXENV/py31/label/linux/.tox/py31/lib/python3.1/site-packages/pip-1.0.1-py3.1.egg/pip/download.py", line 449, in unpack_http_url
download_hash = _download_url(resp, link, temp_location)
File "/home/ci/workspace/pytest-xdist/TOXENV/py31/label/linux/.tox/py31/lib/python3.1/site-packages/pip-1.0.1-py3.1.egg/pip/download.py", line 349, in _download_url
total_length = int(resp.info()['content-length'])
TypeError: int() argument must be a string or a number, not 'NoneType'

This one-line patch fixes it: http://paste.pocoo.org/show/432513/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment