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

`find_command` should not raise AttributeError #274

Closed
hltbra opened this Issue Apr 28, 2011 · 0 comments

Comments

Projects
None yet
1 participant
@hltbra
Member

hltbra commented Apr 28, 2011

If there is no PATH environment variable defined, and pip needs to use pip.util.find_command, it crashes. The problem is at line pip/util.py:74:

paths = os.environ.get('PATH', []).split(os.pathsep)

Showing failure:

$ unset PATH
$ ~/.virtualenvs/NOPATH/bin/pip install git+http://foo.com#egg=mypackage
Downloading/unpacking git+http://foo.com
  Cloning http://foo.com to /var/folders/dJ/dJV4L+tBHli9B7OhUAvPBE+++TQ/-Tmp-/pip-94pfXx-build
Exception:
Traceback (most recent call last):
  File "/Users/hugo/.virtualenvs/NOPATH/lib/python2.6/site-packages/pip/basecommand.py", line 126, in main
    self.run(options, args)
  File "/Users/hugo/.virtualenvs/NOPATH/lib/python2.6/site-packages/pip/commands/install.py", line 223, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/Users/hugo/.virtualenvs/NOPATH/lib/python2.6/site-packages/pip/req.py", line 955, in prepare_files
    self.unpack_url(url, location, self.is_download)
  File "/Users/hugo/.virtualenvs/NOPATH/lib/python2.6/site-packages/pip/req.py", line 1066, in unpack_url
    return unpack_vcs_link(link, location, only_download)
  File "/Users/hugo/.virtualenvs/NOPATH/lib/python2.6/site-packages/pip/download.py", line 292, in unpack_vcs_link
    vcs_backend.unpack(location)
  File "/Users/hugo/.virtualenvs/NOPATH/lib/python2.6/site-packages/pip/vcs/__init__.py", line 228, in unpack
    self.obtain(location)
  File "/Users/hugo/.virtualenvs/NOPATH/lib/python2.6/site-packages/pip/vcs/git.py", line 107, in obtain
    call_subprocess([self.cmd, 'clone', '-q', url, dest])
  File "/Users/hugo/.virtualenvs/NOPATH/lib/python2.6/site-packages/pip/vcs/__init__.py", line 108, in cmd
    command = find_command(self.name)
  File "/Users/hugo/.virtualenvs/NOPATH/lib/python2.6/site-packages/pip/util.py", line 74, in find_command
    paths = os.environ.get('PATH', []).split(os.pathsep)
AttributeError: 'list' object has no attribute 'split'

Storing complete log in /Users/hugo/.pip/pip.log

hltbra added a commit that referenced this issue Apr 28, 2011

@hltbra hltbra closed this Apr 28, 2011

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