Red Hat Bugzilla – Bug 841809
python-bugzilla fails to complete query
Last modified: 2013-01-10 01:52:22 EST
Description of problem:
My bug query script fails with the latest version of python-bugzilla
Version-Release number of selected component (if applicable):
[swhiteho@sts-a ~]$ rpm -qi python-bugzilla
Name : python-bugzilla Relocations: (not relocatable)
Version : 0.7.0 Vendor: Fedora Project
Release : 1.el6 Build Date: Thu 14 Jun 2012 06:20:19 PM CDT
Install Date: Thu 19 Jul 2012 11:31:01 PM CDT Build Host: x86-17.phx2.fedoraproject.org
Group : Development/Languages Source RPM: python-bugzilla-0.7.0-1.el6.src.rpm
Size : 344191 License: GPLv2+
Signature : RSA/8, Thu 14 Jun 2012 06:42:54 PM CDT, Key ID 3b49df2a0608b895
Packager : Fedora Project
URL : https://fedorahosted.org/python-bugzilla
Summary : A python library for interacting with Bugzilla
python-bugzilla is a python library for interacting with bugzilla instances
over XML-RPC. This package also includes the 'bugzilla' command-line tool
for interacting with bugzilla from shell scripts.
Steps to Reproduce:
1. Run script
[swhiteho@sts-a ~]$ ./tasks.sh
Traceback (most recent call last):
File "/home/msp/swhiteho/bz.py", line 38, in <module>
res = bz.query(q)
File "/usr/lib/python2.6/site-packages/bugzilla/base.py", line 544, in query
r = self._query(query)
File "/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.py", line 573, in _query
File "/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.py", line 413, in pre_translation
AttributeError: 'str' object has no attribute 'remove'
Script should complete normally.
This worked perfectly ok until this latest update.
Created attachment 599344 [details]
Shell script which runs python script (normally from cron)
Created attachment 599345 [details]
Note that this script needs editing to add your username and bugzilla password at the top of it, in order to make it work. For obvious reasons I removed my password and left an empty string there.
I fixed your script issues. Basically there were two problems.
One the 'column_list' was a string instead of an array. Not sure it worked on the old RH Bugzillas, but using an array always worked both old and new, so making that change would be recommended.
The second problem was the flag stuff. The flag stuff changed in the new RH Bugzilla so it breaks your hardcoded flagtypes.name. Just easier to grab a 'flags' field in the 'column_list' and parse directly. I belive it gives the same results.
Anyway I will attach a patch that has the fixes for bz.py for you to review and apply.
Created attachment 600834 [details]
changes to make bz.py work on bugzilla-0.7.0
This patch makes the script complete on my end. Not sure the data is correct.
Given Don's recommended fixes, just closing this. If python-bugzilla was in the business of making all this back compat stuff continue to work we would be in a world of hurt given all the RHBZ changes going on.