python-bugzilla icon indicating copy to clipboard operation
python-bugzilla copied to clipboard

Bugzilla.fix_url() fails to extend GCC Bugzilla URL to an XMLRPC URL

Open yizhengx opened this issue 3 years ago • 0 comments

https://github.com/python-bugzilla/python-bugzilla/blob/a7c324041175a4157823bc2332a046cc2a54d105/bugzilla/base.py#L137-L160

When I try to initialize Bugzilla with GCC Bugzilla url "gcc.gnu.org/bugzilla", it fails to initialize Bugzilla since it fails to extend the url to an XMLRPC url, but it works fine with "gcc.gnu.org/bugzilla/xmlrpc.cgi". Probably useful to enhance fix_url() to solve this type of urls.

Traceback (most recent call last):
  File "/Users/yizhengxie/Desktop/untitled_folder/test.py", line 19, in <module>
    bzapi = bugzilla.Bugzilla(URL_gcc)
  File "/Users/yizhengxie/Desktop/untitled_folder/bugzilla/base.py", line 251, in __init__
    self.connect(url)
  File "/Users/yizhengxie/Desktop/untitled_folder/bugzilla/base.py", line 526, in connect
    version = self._backend.bugzilla_version()["version"]
  File "/Users/yizhengxie/Desktop/untitled_folder/bugzilla/_backendxmlrpc.py", line 146, in bugzilla_version
    return self._xmlrpc_proxy.Bugzilla.version()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/xmlrpc/client.py", line 1109, in __call__
    return self.__send(self.__name, args)
  File "/Users/yizhengxie/Desktop/untitled_folder/bugzilla/_backendxmlrpc.py", line 125, in _ServerProxy__request
    ret = ServerProxy._ServerProxy__request(
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/xmlrpc/client.py", line 1450, in __request
    response = self.__transport.request(
  File "/Users/yizhengxie/Desktop/untitled_folder/bugzilla/_backendxmlrpc.py", line 100, in request
    return self.__request_helper(url, request_body)
  File "/Users/yizhengxie/Desktop/untitled_folder/bugzilla/_backendxmlrpc.py", line 63, in __request_helper
    raise e
  File "/Users/yizhengxie/Desktop/untitled_folder/bugzilla/_backendxmlrpc.py", line 47, in __request_helper
    return self.parse_response(response)
  File "/Users/yizhengxie/Desktop/untitled_folder/bugzilla/_backendxmlrpc.py", line 77, in parse_response
    parser.feed(msg)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/xmlrpc/client.py", line 438, in feed
    self._parser.Parse(data, 0)
bugzilla.exceptions.BugzillaError: mismatched tag: line 70, column 4
The URL may not be an XMLRPC URL: https://gcc.gnu.org/bugzilla

yizhengx avatar Jul 16 '22 00:07 yizhengx