Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 54834

Summary: portage_db_flat.py: undefined reference to key_exists
Product: Portage Development Reporter: Simone Piccinini <arcosen>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: minor    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Simone Piccinini 2004-06-22 17:12:44 UTC
not expert in python but i think /usr/lib/portage/pym/portage_db_flat.py line 96:
 if self.key_exists(key):
should be:
 if self.has_key(key):

sorry for my english

Reproducible: Always
Steps to Reproduce:
1.cd /usr/lib/portage/pym
2.python
3.import database from portage_db_flat
4.d=database("/var/db","pkg",None,1000,100)
5.d.del_key("foo")
Actual Results:  
>>> d.del_key("foo")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/portage/pym/portage_db_flat.py", line 96, in del_key
    if self.key_exists(key):
AttributeError: database instance has no attribute 'key_exists'
>>>


portage version: 2.0.50-r8
Comment 1 Brian Harring (RETIRED) gentoo-dev 2004-06-22 20:39:46 UTC
yeah, it should be self.has_key(key)

I'm kind of amazed nobody has bumped into this- this is guranteed to bork every time.
Comment 2 Brian Harring (RETIRED) gentoo-dev 2004-07-07 18:59:20 UTC
This still is an issue...

possily another .50? 
I don't like the notion of users/devs hitting borkage....