Bug 998256

Summary: raw output: ATTRIBUTE[_dowhiteboard]: <bound method _Bug._dowhiteboard of <Bug #871637 on https://bugzilla.redhat.com/xmlrpc.cgi at 0xda7dd0>>
Product: [Fedora] Fedora Reporter: Steve Tyler <stephent98>
Component: python-bugzillaAssignee: Will Woods <wwoods>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: bugs.michael, crobinso, dzickus, jskarvad, stephent98, wwoods
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-bugzilla-1.0.0-2.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-09 00:56:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
[debugging] bz998256-raw-field-type-debugging-1.patch none

Description Steve Tyler 2013-08-18 16:29:55 UTC
Description of problem:
Some fields in raw output have a value beginning: '<bound method _Bug':

$ bugzilla query -b 871637 --raw | fgrep '<bound method _Bug' | head -1
ATTRIBUTE[_dowhiteboard]: <bound method _Bug._dowhiteboard of <Bug #871637 on https://bugzilla.redhat.com/xmlrpc.cgi at 0x246add0>>

Version-Release number of selected component (if applicable):
python-bugzilla-0.9.0-1.fc19.noarch

How reproducible:
Always.

Steps to Reproduce:
1. $ bugzilla query -b 871637 --raw | fgrep '<bound method _Bug'

Actual results:

The first string returned:

ATTRIBUTE[_dowhiteboard]: <bound method _Bug._dowhiteboard of <Bug #871637 on https://bugzilla.redhat.com/xmlrpc.cgi at 0x17c6dd0>>

There are 22 in all:

$ bugzilla query -b 871637 --raw | fgrep '<bound method _Bug' | wc -l
22

Expected results:
A field value is displayed, or nothing at all. 

Additional info:

Comment 1 Steve Tyler 2013-08-18 16:59:53 UTC
Created attachment 787795 [details]
[debugging] bz998256-raw-field-type-debugging-1.patch

This debugging patch shows that the test in line 696 is incomplete. In particular, the test fails to detect attributes of <type 'instancemethod'>:

ATTRIBUTE[_dowhiteboard]: (<type 'instancemethod'>) <bound method _Bug._dowhiteboard of <Bug #986069 on https://bugzilla.redhat.com/xmlrpc.cgi at 0x256fc10>>

$ less -N python-bugzilla-0.9.0/bin/bugzilla
...
    690 def _format_output(bz, opt, buglist):
    691     if opt.output == 'raw':
    692         buglist = bz.getbugs([b.bug_id for b in buglist])
    693         for b in buglist:
    694             print "Bugzilla %s: " % b.bug_id
    695             for a in dir(b):
    696                 if a.startswith("__") and a.endswith("__"):
    697                     continue
    698                 print to_encoding(u"ATTRIBUTE[%s]: %s" % (a, getattr(b, a)))
    699             print "\n\n"
    700         return
...

Comment 2 Cole Robinson 2013-10-28 17:48:33 UTC
Fixed upstream now:

commit 0fc2285690a96fdc9d04d6946af1c25ea5102ac5
Author: Cole Robinson <crobinso>
Date:   Mon Oct 28 13:46:56 2013 -0400

    bugzilla: Don't show methods in --raw output (bz 998256)

Comment 3 Fedora Update System 2014-03-25 22:44:30 UTC
python-bugzilla-1.0.0-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/python-bugzilla-1.0.0-1.fc19

Comment 4 Fedora Update System 2014-03-27 04:47:28 UTC
Package python-bugzilla-1.0.0-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-bugzilla-1.0.0-1.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-4391/python-bugzilla-1.0.0-1.fc19
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2014-03-27 17:13:51 UTC
python-bugzilla-1.0.0-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/python-bugzilla-1.0.0-2.fc19

Comment 6 Fedora Update System 2014-04-09 00:56:11 UTC
python-bugzilla-1.0.0-2.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.