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=triaging&buglistsort=product,asc,category,asc,component,asc"
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