Bug 189612 - Run-time failure in packageSack.py
Run-time failure in packageSack.py
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
: Reopened
: 220841 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2006-04-21 12:28 EDT by Michael Schwendt
Modified: 2014-01-21 17:54 EST (History)
2 users (show)

See Also:
Fixed In Version: 3.0.6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-04-25 13:29:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch against yum-2.6.0-1 packageSack.py (852 bytes, patch)
2006-04-21 12:28 EDT, Michael Schwendt
no flags Details | Diff
patch returnNewestByName to make it return a list (557 bytes, patch)
2006-04-21 13:56 EDT, Michael Schwendt
no flags Details | Diff

  None (edit)
Description Michael Schwendt 2006-04-21 12:28:33 EDT
Exchanging packageSack.returnNewestByNameArch() and
packageSack.returnNewestByName() does not work and raises
an uncaught exception.

The former returns a list, the latter a list of lists, which
leads to a run-time error inside the packageSack module:

  AttributeError: 'list' object has no attribute 'returnSimple'

The documentation doesn't say anything about that difference.
Full traceback below.

I believe the implementation of returnNewestByName() is wrong.
Patch attached, too. At least FC5 and FC4 are affected.

Traceback (most recent call last):
  File "./rc-modified", line 201, in ?
  File "./rc-modified", line 169, in main
    baddeps = my.getBrokenDeps(opts.newest)
  File "./rc-modified", line 96, in getBrokenDeps
    mypkgSack = ListPackageSack(pkgs)
  File "/usr/lib/python2.4/site-packages/repomd/packageSack.py", line 521, in __
  File "/usr/lib/python2.4/site-packages/repomd/packageSack.py", line 525, in ad
  File "/usr/lib/python2.4/site-packages/repomd/packageSack.py", line 163, in ad
    repoid = obj.returnSimple('repoid')
AttributeError: 'list' object has no attribute 'returnSimple'
Comment 1 Michael Schwendt 2006-04-21 12:28:33 EDT
Created attachment 128092 [details]
patch against yum-2.6.0-1 packageSack.py
Comment 2 Michael Schwendt 2006-04-21 12:35:11 EDT
At a second thought, probably returnNewestByName() is correct, so
it can return a list of multiple package with the same EVR but
different archs. In that case, the API documentation is incomplete,

     pkgs = pkgSack.returnNewestByName()
     mypkgSack = ListPackageSack(pkgs)

still gives a traceback.
Comment 3 Michael Schwendt 2006-04-21 13:56:51 EDT
Created attachment 128093 [details]
patch returnNewestByName to make it return a list
Comment 4 Jeremy Katz 2006-09-18 16:28:44 EDT
This has all been cleaned up and made consistent in yum 2.9.x
Comment 5 Michael Schwendt 2006-10-10 07:05:16 EDT
Still reproducible with yum-3.0-3.
Just call yumBase.pkgSack.returnNewestByName() with default argument,
and it creates a "list of lists of package objects" rather than a
"list of package objects":

  File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 298, in
    bestofeach.addList(self._computeAggregateListResult("returnNewestByName", name))
  File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 651, in addList
  File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 475, in
    repoid = obj.returnSimple('repoid')
AttributeError: 'list' object has no attribute 'returnSimple'
Comment 6 Seth Vidal 2006-10-11 09:22:52 EDT
grrr. This is the combination happening.

okay I know what's going on here. Thanks Michael.
Comment 7 Ville Skyttä 2006-12-27 17:51:23 EST
*** Bug 220841 has been marked as a duplicate of this bug. ***
Comment 8 Jeremy Katz 2007-04-25 13:29:48 EDT
This looks fixed in 3.0.6/3.1.6 to me

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