RPM

hdr.dsFromHeader() fails with "SystemError" for gpg-pubkeys

Bug #651441 reported by Jeff Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
RPM
New
Undecided
Unassigned
Fedora
Fix Released
Medium

Bug Description

tracker

Tags: python pubkeys
Jeff Johnson (n3npq)
tags: added: pubkeys python
Revision history for this message
In , RHEL (rhel-redhat-bugs) wrote :

This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Revision history for this message
In , Karel (karel-redhat-bugs) wrote :

Hi Panu,
I can see some differences between RHEL6.2 and RHEL5.8. Why is rpm.ds class printed as empty string?

RHEL6.2:

>>> import rpm
>>> for hdr in rpm.TransactionSet().dbMatch("name", "gpg-pubkey"):
... hdr.dsFromHeader()
...
<rpm.ds object at 0x7fe60a6f88f0>
<rpm.ds object at 0x7fe60a6f8878>
<rpm.ds object at 0x7fe60a6f88f0>
<rpm.ds object at 0x7fe60a6f8878>

RHEL5.8 with rpm-4.4.2.3-26.el5:

>>> import rpm
>>> for hdr in rpm.TransactionSet().dbMatch("name", "gpg-pubkey"):
... hdr.dsFromHeader()
...

>>>
>>> list(rpm.TransactionSet().dbMatch("name", "gpg-pubkey"))
[<rpm.hdr object at 0xb7f0bd40>, <rpm.hdr object at 0xb7f0bda0>]
>>> a,b = _
>>> a
<rpm.hdr object at 0xb7f0bd40>
>>> a.dsFromHeader()

>>> repr(a.dsFromHeader())
'<rpm.ds object at 0xb7f37578>'
>>> a.dsFromHeader().__class__
<type 'rpm.ds'>
>>>

Revision history for this message
In , Panu (panu-redhat-bugs) wrote :

The difference comes from rpm-4.4.x python bindings incorrectly implementing a "print" method for various types, including the "ds":
http://docs.python.org/c-api/typeobj.html#tp_print

In 4.4.x those print methods end up literally calling fprintf() on stdout when it should just represent itself as a string or such, this bogosity has been removed in newer versions. You would generally only see this difference when using the python interpreter interactively, in an actual script the print method wouldn't be invoked in a situation like this.

Revision history for this message
In , errata-xmlrpc (errata-xmlrpc-redhat-bugs) wrote :

Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0283.html

Changed in fedora:
importance: Unknown → Medium
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.