From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020610 Description of problem: I try to use rpm-python with rpm-4.1 and found what it doesn't work at all. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.start python 2.imput next strings: import rpm rpm.opendb() 3. look at error :) Actual Results: >>> import rpm >>> rpm.opendb() Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'module' object has no attribute 'opendb' >>> Expected Results: >>> import rpm >>> rpm.opendb() <rpmdb object at 80dc6b0> Additional info: If you take a look at rpm cvs you can see what something wrong with that: black@black:/opt/CVS/rpm/python (1028) grep opendb * */* rpmdb-py.c: * To obtain a db object explicitly, the opendb function in the rpm module rpmdb-py.c: * can be called. The opendb function takes two optional arguments. rpmdb-py.c: * db = rpm.opendb() rpmdb-py.c: * db = rpm.opendb() rpmdb-py.c: * db = rpm.opendb() testhdr:db = rpm.opendb(0) testit:db = rpm.opendb () testmi:db = rpm.opendb(0) in other words - somebody forget to export opendb function :)
No, someone (me) forgot to change the doco. The rpm database is handled as a side effect of transaction processing and explicit methods have been removed from the python bindings.
May be mutch better solution is 1) Add empty method opendb what throw exception ("Obsolete"). 2) Add empty method opendb what just printout "This method is obsolete (use blahblah instead)" like "regex" module in python2.x And thanks for fast answer.
Sure there are lots of ways to handle API changes, but an rpm-python API needs to be designed first. What's currently implemented is deficient in many ways, and rather organic rather than designed. I'm gonna close this bug because rpmdb-py.c is gonna be eliminated in rpm-4.2 AFAIK, so there's little reason to change (i.e. delete) the documentation for non-existent methods in the interim. Poke me on rpm-list if you need further help. And, I *love* patches :-)