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

Already on GitHub? Sign in to your account

Some pypi packages cause search to raise exceptoin #482

Closed
subiet opened this Issue Mar 14, 2012 · 5 comments

Comments

Projects
None yet
2 participants

subiet commented Mar 14, 2012

Environment Information:

Python 3.2.2 (default, Nov 21 2011, 16:51:01)
[GCC 4.6.2] on linux2
Linux arch 3.2.9-1-ARCH

Issue

$ pip search "python imaging library"
works but
$ pip search python imaging library
raises

Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.2/site-packages/pip/basecommand.py", line 104, in main
    status = self.run(options, args)
  File "/usr/lib/python3.2/site-packages/pip/commands/search.py", line 35, in run
    hits = transform_hits(pypi_hits)
  File "/usr/lib/python3.2/site-packages/pip/commands/search.py", line 76, in transform_hits
    package_list = sorted(packages.values(), key=lambda x: x['score'], reverse=True)
TypeError: unorderable types: NoneType() < int()

Storing complete log in /home/subiet/.pip/pip.log

Surprisingly
$ pip search string1 string2 string3
works, but then again it raises the same exception for other string combinations.

Contributor

pnasrat commented Mar 18, 2012

Confirmed on development branch

Contributor

pnasrat commented Mar 18, 2012

[ (v['score'], v['name']) for v in packages.values()  if v['score'] is None]
[(None, 'SANE'), (None, 'python-elvin')]
Contributor

pnasrat commented Mar 18, 2012

So this isn't related to quoting, but the fact part of your search (python) pulls in a package which breaks our sorting. I've a fix coming

@pnasrat pnasrat added a commit to pnasrat/pip that referenced this issue Mar 18, 2012

@pnasrat pnasrat Issue #482 search raises exception.
Handle pypi results for packages with no ordering.

TESTED=2.4.6 2.7.1 3.2.2
2606cf3

@ghost ghost assigned pnasrat Mar 18, 2012

@pnasrat pnasrat pushed a commit that referenced this issue Mar 19, 2012

Paul Nasrat Merge pull request #488 from pnasrat/482-no-ordering
Issue #482 search raises exception.
87c719c
Contributor

pnasrat commented Mar 19, 2012

Fixed on develop branch. Thank you for your bug report.

@pnasrat pnasrat closed this Mar 19, 2012

subiet commented Mar 19, 2012

Ahh, great! Was thinking it wouldn't be an quote issue as it was working with some cases.

@bernardofire bernardofire added a commit to bernardofire/pip that referenced this issue May 2, 2012

@pnasrat @bernardofire pnasrat + bernardofire Issue #482 search raises exception.
Handle pypi results for packages with no ordering.

TESTED=2.4.6 2.7.1 3.2.2
573e79b

@ptone ptone added a commit to ptone/pip that referenced this issue Jun 21, 2012

@ptone ptone Merge branches 'develop' and 'develop' of git://github.com/pypa/pip i…
…nto develop

* 'develop' of git://github.com/pypa/pip:
  Fixed a test that was failing intermittently due to pyc file race conditions.
  Fixed #487 - don't check for best-version-already-installed with explicit-URL requirements when upgrading.
  Issue #482 search raises exception.
  Fix upgrade of VCS requirement with otherwise nonexistent egg. Fixes #486.

* 'develop' of git://github.com/pypa/pip:
  Fixed a test that was failing intermittently due to pyc file race conditions.
  Fixed #487 - don't check for best-version-already-installed with explicit-URL requirements when upgrading.
  Issue #482 search raises exception.
  Fix upgrade of VCS requirement with otherwise nonexistent egg. Fixes #486.
7598932
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment