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 change. Version-Release number of selected component (if applicable): 4.2.1 How reproducible: Always
Ready, willing and able whenever.
-----BEGIN PGP SIGNED MESSAGE----- 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. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/uM2ula5U8jydsKoRAgVkAJwI1zcu61ncU/0rtw8AKsnMsaijLwCgh/6o LUtxpVQ+2lUGPQ1Yh5lefXE= =6pzO -----END PGP SIGNATURE-----
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.
+1 to lists and comment 3.
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.
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.
Yes, if the tag normally is a list but has zero elements in the header, return an empty list.
I don't hvae any problem with this that I can think of.
sure
Wheee, consensus!
Created attachment 96720 [details] Simple unit test This is fixed in HEAD and rpm-4_2 and in rpm-4.2.2-0.8 python >>> import rpm >>> ts=rpm.TransactionSet() >>> hdr=ts.dbMatch("Name","rpm").next() >>> hdr[rpm.RPMTAG_OBSOLETEFLAGS] [2] python test_obs.py ... ---------------------------------------------------------------------- Ran 3 tests in 0.060s OK