Hi --
I'd like to update bugwarrior, which uses python-bugzilla, to support API
keys. To do so, I need the newer version of python-bugzilla released.
Any chance we could get a 2.1.0 with that feature included?
Dustin
On 02/19/2017 12:10 AM, 明 wrote:
> Hi specialists,
>
> I'm trying to use python-bugzilla 2.0 to do a saved query, I imitated the
> example to make up a small code snippet like below:
> --------------------------------------------------------------------
> #!/usr/bin/env python
> # encoding: utf-8
>
> from __future__ import print_function
> import time
> import bugzilla
>
> # public test instance of bugzilla.redhat.com <http://bugzilla.redhat.com>.
> It's okay to make changes
> login_URL = "https://bugzilla.mycompany.com/index.cgi"
This looks incorrect, you should point to xmlrpc.cgi, not index.cgi
- Cole
> URL =
> "https://bugzilla.mycompany.com/buglist.cgi?cmdtype=runnamed&namedcmd=triagi…"
> bzapi = bugzilla.Bugzilla(login_URL, user='xxx', password='xxxxx')
>
>
> query = bzapi.url_to_query(URL)
> query["include_fields"] = ["id", "summary"]
> bugs = bzapi.query(query)
> print("The URL query returned %d bugs" % len(bugs))
> -----------------------------------------------------------------------------
>
>
> But I always got such errors in my macbook env:
> ============================================
> mingMBA:python-buzilla mingli$ python query.py
> Traceback (most recent call last):
> File "query.py", line 11, in <module>
> bzapi = bugzilla.Bugzilla(login_URL, user='xxx', password='xxxxx')
> File "build/bdist.macosx-10.12-intel/egg/bugzilla/base.py", line 289, in
> __init__
> File "build/bdist.macosx-10.12-intel/egg/bugzilla/base.py", line 508, in connect
> File "build/bdist.macosx-10.12-intel/egg/bugzilla/base.py", line 556, in login
> File "build/bdist.macosx-10.12-intel/egg/bugzilla/base.py", line 525, in _login
> File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py",
> line 1240, in __call__
> return self.__send(self.__name, args)
> File "build/bdist.macosx-10.12-intel/egg/bugzilla/transport.py", line 88, in
> _ServerProxy__request
> File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py",
> line 1599, in __request
> verbose=self.__verbose
> File "build/bdist.macosx-10.12-intel/egg/bugzilla/transport.py", line 183,
> in request
> File "build/bdist.macosx-10.12-intel/egg/bugzilla/transport.py", line 174,
> in _request_helper
> bugzilla.transport.BugzillaError: not well-formed (invalid token): line 66,
> column 97
> ===========================================================
>
> It's seems my user or password string's format not correct?
> Is this related to the env that I use company's proxy to connect company
> network from home?
>
> Very expecting your reply!
>
> Thanks,
> Ming
I have some code that looks very similar to what I have below.
from bugzilla.rhbugzilla import RHBugzilla
BUGZILLA_URL = 'https://bugzilla.redhat.com'
BZ = RHBugzilla(url='%s/xmlrpc.cgi' % BUGZILLA_URL, user=user,
password=password)
bugzilla_bugs =
BZ.query(RHBugzilla.url_to_query(non_closed_bug_with_ext_tracker))
for bug in bugzilla_bugs:
for external_bug in bug.external_bugs:
print external_bug
This works fine with python-bugzilla 1.2.2, but when switching to 2.0.0, I
get an exception like this:
Traceback (most recent call last):
File "pulp_packaging/ci/redmine_bugzilla.py", line 242, in <module>
main()
File "pulp_packaging/ci/redmine_bugzilla.py", line 193, in main
for external_bug in bug.external_bugs:
File "/usr/lib/python2.7/site-packages/bugzilla/bug.py", line 110, in
__getattr__
raise AttributeError(msg)
AttributeError: Bug object has no attribute 'external_bugs'.
Does anyone have a suggestion for how to fix my script?
Thanks,
Dennis
Hi Cole and all,
Before filling bug I'd like to check whether there is an PEPKAC or
not. Following code stopped working after I've updated from
python-bugzilla-1.2.2-4.fc25 to python-bugzilla-2.0.0-1.fc25
from bugzilla import Bugzilla
BUGZILLA_URL = "https://bugzilla.redhat.com/xmlrpc.cgi"
bz = Bugzilla(url=BUGZILLA_URL)
bz.connect(BUGZILLA_URL
I've run bugzilla login before, bugzilla binary seems to work correctly.
What am I doing wrong? The error looks like it is a server side issue.
Thanks for any hints. If necessary I'll open bug ;)
Traceback is
Traceback (most recent call last):
File "repro.py", line 5, in <module>
bz.connect(BUGZILLA_URL)
File "/usr/lib/python2.7/site-packages/bugzilla/base.py", line 489, in connect
if self._proxy:
File "/usr/lib64/python2.7/xmlrpclib.py", line 1243, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.7/site-packages/bugzilla/transport.py", line
88, in _ServerProxy__request
ret = ServerProxy._ServerProxy__request(self, methodname, params)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1602, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/site-packages/bugzilla/transport.py", line
183, in request
return self._request_helper(url, request_body)
File "/usr/lib/python2.7/site-packages/bugzilla/transport.py", line
169, in _request_helper
raise sys.exc_info()[1]
xmlrpclib.Fault: <Fault Client: "Can't locate .pm in @INC (@INC
contains: /var/www/html/bugzilla/extensions CODE(0x7f971c1f7f68)
CODE(0x7f971c1aeb68) CODE(0x7f971c0dfa58) CODE(0x7f971c0d6010)
CODE(0x7f971c8671a8) CODE(0x7f971c825960) CODE(0x7f971ccf3730)
CODE(0x7f971ccf2e60) CODE(0x7f971cc04fc8) CODE(0x7f971d599860)
CODE(0x7f971d4aa200) CODE(0x7f971d96f550) CODE(0x7f971d967ed0)
CODE(0x7f971d967498) CODE(0x7f971d93ffc8) CODE(0x7f971d8a8298)
CODE(0x7f971d933850) CODE(0x7f971d833228) CODE(0x7f971d822348)
CODE(0x7f971d7d1a70) CODE(0x7f971c310a70) CODE(0x7f971b741878)
/var/www/html/bugzilla/lib /var/www/html/bugzilla
/usr/local/lib64/perl5 /usr/local/share/perl5
/usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl
/usr/lib64/perl5 /usr/share/perl5 /etc/httpd) at
/var/www/html/bugzilla/Bugzilla/WebService/Server/XMLRPC.pm line
79.\n">
--
Lukas Zachar
BaseOS QE - Apps
lzachar: #brno, #urt, #qa
Hey there!
I am writing a Telegram Bugzilla bot based on Python Bugzilla and I am
trying unsuccessfully to fetch RH's internal bugs and all I get are the
upstream ones.
I am using my account to log in..
What am I doing wrong?
Thanks!
Pavel
I'm happy to announce a new release of python-bugzilla, version 2.0.0.
python-bugzilla is a library and commandline tool for interacting with
a bugzilla instance, including querying, modifying, and creating bug reports.
The release can be downloaded from:
https://github.com/python-bugzilla/python-bugzilla/archive/v2.0.0.tar.gzhttps://pypi.python.org/pypi/python-bugzilla/2.0.0
This release contains several small to medium API breaks. I expect most users
won't notice any difference. I previously outlined the changes here:
https://lists.fedorahosted.org/archives/list/python-bugzilla@lists.fedoraho…
The major changes are:
- Several fixes for use with bugzilla 5
- Bugzilla.bug_autorefresh now defaults to False
- Credentials are now cached in ~/.cache/python-bugzilla/
- bin/bugzilla was converted to argparse
- bugzilla query --boolean_chart option is removed
- Unify command line flags across sub commands
Thanks to everyone who has contributed to this release through testing,
bug reporting, submitting patches, and otherwise sending in feedback!
Thanks,
Cole
Hey there!
I am writing a Telegram Bugzilla Bot and I am trying to fetch internal Red Hat bugs and for some reason I faill..
All my queries are the upstream bugs which are nice but not exactly what I'm looking for.
Anybody's available to give me a hand?
Thanks! Pavel