Issue when trying to remove from list twice. #34

Closed
vbabiy opened this Issue Mar 15, 2011 · 11 comments

5 participants

@vbabiy

https://bitbucket.org/ianb/pip/src/a6b8ba6c4096/pip/req.py#cl-277

If you have a tests/bin dir the first if will remove the dir because of 'bin', then the second if will try to remove because of 'tests' but since the dir is no longer in the list you get: ValueError: list.remove(x): x not in list


@vbabiy

Thanks for reporting this issue. Is there a specific package that triggered
this bug? If so, I could use it to reproduce this bug before proposing a
solution.


Original Comment By: Kelsey Hightower
@vbabiy

This happens after tests for django-cms has been run using buildout before
trying to install from a dir using pip -e /path/to/checkout/

But easy to reproduce.

In the same dir as setup.py

mkdir tests

mkdir tests/bin

pip install -e .


Original Comment By: fivethreeo
@vbabiy

Thanks, now let me try and reproduce this.


Original Comment By: Kelsey Hightower
@vbabiy

I have run the follow steps in an attempt to reproduce your issue. I am
running pip 8.2 on python 2.7. I was not able to reproduce your issue, maybe I
am doing something wrong. Please review the steps below and let me know if I
am not "doing it right" :)

[root@centos ~]# git clone https://github.com/divio/django-cms.git

Cloning into django-cms...

remote: Counting objects: 22460, done.

remote: Compressing objects: 100% (8621/8621), done.

remote: Total 22460 (delta 13618), reused 21127 (delta 12408)

Receiving objects: 100% (22460/22460), 9.09 MiB | 2.23 MiB/s, done.

Resolving deltas: 100% (13618/13618), done.


[root@centos ~]# cd django-cms/


[root@centos django-cms]# ls

AUTHORS  CHANGELOG.txt  cms  docs  example  LICENSE  MANIFEST.in  menus

publisher README.rst runtests.sh setup.py tests

[root@centos django-cms]# ls tests/

bootstrap.py  buildout.cfg  django-svn.cfg  testapp


[root@centos django-cms]# mkdir tests/bin


[root@centos django-cms]# /opt/OpenPython-2.7.1/bin/pip install -e .

Obtaining file:///root/django-cms

  Running setup.py egg_info for package from file:///root/django-cms


... omitting output


   Creating /opt/OpenPython-2.7.1/lib/python2.7/site-packages/django-cms

.egg-link (link to .)

    Adding django-cms 2.1.0 to easy-install.pth file


    Installed /root/django-cms

Successfully installed Django django-classy-tags PIL south django-mptt

django-cms

Cleaning up...

Original Comment By: Kelsey Hightower
@vbabiy

My bad, was missing something. :)

mkdir tests/bin

touch tests/bin/python


Original Comment By: fivethreeo
@vbabiy

I am able to reproduce this error now. Working on a patch.


Original Comment By: Kelsey Hightower
@vbabiy

Fixed in my fork:

The following works now:

# pip install -e .


Obtaining file:///root/django-cms

  Running setup.py egg_info for package from file:///root/django-cms


    warning: no files found matching '*.json' under directory

'mptt/tests/fixtures'

Requirement already satisfied (use --upgrade to upgrade): Django>=1.2 in

/opt/OpenPython-2.7/lib/python2.7/site-packages (from django-cms)

Requirement already satisfied (use --upgrade to upgrade): django-classy-

tags>=0.2.2 in /opt/OpenPython-2.7/lib/python2.7/site-packages (from django-
cms)

Requirement already satisfied (use --upgrade to upgrade): PIL>=1.1.6 in

/opt/OpenPython-2.7/lib/python2.7/site-packages/PIL (from django-cms)

Requirement already satisfied (use --upgrade to upgrade): south>=0.7.2 in

/opt/OpenPython-2.7/lib/python2.7/site-packages (from django-cms)

Requirement already satisfied (use --upgrade to upgrade): django-

mptt>=0.4.2 in /opt/OpenPython-2.7/lib/python2.7/site-packages (from django-
cms)

Installing collected packages: django-cms

  Running setup.py develop for django-cms

    install_dir /opt/OpenPython-2.7/lib/python2.7/site-packages/


    warning: no files found matching '*.json' under directory

'mptt/tests/fixtures'

    Creating /opt/OpenPython-2.7/lib/python2.7/site-packages/django-cms

.egg-link (link to .)

    django-cms 2.1.0 is already the active version in easy-install.pth


    Installed /root/django-cms

Successfully installed django-cms

Cleaning up...

Original Comment By: Kelsey Hightower
@vbabiy

Created a new fork without named branches.

https://bitbucket.org/khightower/pip-issue-205/changeset/b1e3183d6378


Original Comment By: Kelsey Hightower
@hltbra
Python Packaging Authority member

Attaching Kelsey's patch: https://gist.github.com/886020

(The pip-issue-205 repository was removed)

@exhuma

Any news on this? We just lost about one day of work to search for this issue. The error is not very descriptive.

The patch offered by @hltbra checks out. It properly solves the issue. Any plans to merge it? If you'd like I could re-work it as a proper pull request?

Let me know!

@xavfernandez

This can be closed, it was resolved in f14bf22

@dstufft dstufft closed this Mar 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment