Bug 110226 - [RFE] [rpm-python] hdrobject[rpm.RPMTAG_REQUIREFLAGS] should always return a list object
[RFE] [rpm-python] hdrobject[rpm.RPMTAG_REQUIREFLAGS] should always return a ...
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2003-11-17 05:03 EST by Paul Nasrat
Modified: 2014-01-21 17:48 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-12-30 10:47:29 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Simple unit test (795 bytes, text/plain)
2003-12-29 07:16 EST, Paul Nasrat
no flags Details

  None (edit)
Description Paul Nasrat 2003-11-17 05:03:21 EST
Description of problem:

As requested in your email to the list this is a tracker bug for the
RFE to change the behaviour or this to always return a list.  I will
poke the key rpm-python api users to add a comment signing off this

Version-Release number of selected component (if applicable):


How reproducible:

Comment 1 Jeff Johnson 2003-11-17 06:10:38 EST
Ready, willing and able whenever.
Comment 2 Panu Matilainen 2003-11-17 08:30:57 EST
Hash: SHA1
I hardly qualify as "a major user" but here's my humble +1 for this change
anyway, would make life just that little bit easier with rpm-python.
Version: GnuPG v1.2.3 (GNU/Linux)
Comment 3 Seth Vidal 2003-11-17 08:54:12 EST
this should be the same for requires,provides, conflicts and obsoletes.

Hell in general everything that can return a list object should always
return a list object, even when it is empty.
Comment 4 Ville Skyttä 2003-11-25 16:57:13 EST
+1 to lists and comment 3.
Comment 5 Jeff Johnson 2003-12-18 07:11:38 EST
I do not have sign off from alikins, sopwith, nor katzj, and
hence cannot make the change. Possibly timp needs ack too.

Reopen if/when necessary signoff is acquired.
Comment 6 Tim Powers 2003-12-18 08:38:21 EST
I concur with Seth's comment (#3). The same object should be returned
regardless of length. If it's going to return a list of ints, it
should always be a list of ints (even if there's nothing to return,
return an empty list), if it can return a list of strings, it should
always return a list...as so on.
Comment 7 Elliot Lee 2003-12-18 08:52:16 EST
Yes, if the tag normally is a list but has zero elements in the
header,  return an empty list.
Comment 8 Jeremy Katz 2003-12-18 10:42:15 EST
I don't hvae any problem with this that I can think of.
Comment 9 Adrian Likins 2003-12-18 13:27:13 EST
Comment 10 Jeff Johnson 2003-12-18 13:55:54 EST
Wheee, consensus!
Comment 11 Paul Nasrat 2003-12-29 07:16:12 EST
Created attachment 96720 [details]
Simple unit test

This is fixed in HEAD and rpm-4_2 and in rpm-4.2.2-0.8

>>> import rpm
>>> ts=rpm.TransactionSet()
>>> hdr=ts.dbMatch("Name","rpm").next()

python test_obs.py
Ran 3 tests in 0.060s

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