Bug 189612 - Run-time failure in packageSack.py
Summary: Run-time failure in packageSack.py
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact:
URL:
Whiteboard:
: 220841 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-04-21 16:28 UTC by Michael Schwendt
Modified: 2014-01-21 22:54 UTC (History)
2 users (show)

Fixed In Version: 3.0.6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-04-25 17:29:48 UTC
Type: ---
Embargoed:


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

Description Michael Schwendt 2006-04-21 16:28:33 UTC
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 ?
    main()
  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 __
init__
    self.addList(Objlist)
  File "/usr/lib/python2.4/site-packages/repomd/packageSack.py", line 525, in ad
dList
    self.addPackage(pkgobj)
  File "/usr/lib/python2.4/site-packages/repomd/packageSack.py", line 163, in ad
dPackage
    repoid = obj.returnSimple('repoid')
AttributeError: 'list' object has no attribute 'returnSimple'

Comment 1 Michael Schwendt 2006-04-21 16:28:33 UTC
Created attachment 128092 [details]
patch against yum-2.6.0-1 packageSack.py

Comment 2 Michael Schwendt 2006-04-21 16:35:11 UTC
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,
and

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

still gives a traceback.


Comment 3 Michael Schwendt 2006-04-21 17:56:51 UTC
Created attachment 128093 [details]
patch returnNewestByName to make it return a list

Comment 4 Jeremy Katz 2006-09-18 20:28:44 UTC
This has all been cleaned up and made consistent in yum 2.9.x

Comment 5 Michael Schwendt 2006-10-10 11:05:16 UTC
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
returnNewestByName
    bestofeach.addList(self._computeAggregateListResult("returnNewestByName", name))
  File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 651, in addList
    self.addPackage(pkgobj)
  File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 475, in
addPackage
    repoid = obj.returnSimple('repoid')
AttributeError: 'list' object has no attribute 'returnSimple'


Comment 6 Seth Vidal 2006-10-11 13:22:52 UTC
grrr. This is the combination happening.

okay I know what's going on here. Thanks Michael.


Comment 7 Ville Skyttä 2006-12-27 22:51:23 UTC
*** Bug 220841 has been marked as a duplicate of this bug. ***

Comment 8 Jeremy Katz 2007-04-25 17:29:48 UTC
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.