Bug 873875 - Python crash if dnf search BLAH does not work.
Summary: Python crash if dnf search BLAH does not work.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ales Kozumplik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 874866 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-06 21:36 UTC by Daniel Walsh
Modified: 2014-09-30 23:40 UTC (History)
3 users (show)

Fixed In Version: dnf-0.2.16
Clone Of:
Environment:
Last Closed: 2013-03-25 09:45:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Daniel Walsh 2012-11-06 21:36:54 UTC
dnf search BLAH
Traceback (most recent call last):
  File "/bin/dnf", line 35, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/yummain.py", line 316, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/yummain.py", line 140, in main
    result, resultmsgs = base.doCommands()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 483, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/lib/python2.7/site-packages/dnf/cli/yumcommands.py", line 1254, in doCommand
    return base.search(extcmds)
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1217, in search
    for pkg in counter.sorted(reverse=True, limit_to=limit):
  File "/usr/lib/python2.7/site-packages/dnf/match_counter.py", line 81, in sorted
    return sorted(keys, key=self._key_func(), reverse=reverse)
  File "/usr/lib/python2.7/site-packages/dnf/match_counter.py", line 54, in _key_func
    max_length = self._max_needles()
  File "/usr/lib/python2.7/site-packages/dnf/match_counter.py", line 61, in _max_needles
    return max(map(lambda pkg: len(self.matched_needles(pkg)), self))
ValueError: max() arg is an empty sequence

Comment 1 Ales Kozumplik 2012-11-08 16:09:20 UTC
Thank you for the report, this is fixed now by the commit 2bac2af.

Comment 2 Ales Kozumplik 2012-11-09 07:36:01 UTC
*** Bug 874866 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.