[python-bugzilla] [BUG] Server error: buf must be a byte string

Arun Babu Neelicattu abn at redhat.com
Mon Nov 17 13:57:04 UTC 2014


Jani; for what it is worth, could not reproduce using Python 2.7.5, 2.7.8 and 3.3.2. Tried using both requests 1.x and 2.x too. This might have to do with the proxy issues requests had via urllib3. Think it should be fixed in 2.x.

https://github.com/kennethreitz/requests/pull/478
https://github.com/shazow/urllib3/pull/68

Without knowing your environment that is my best guess. Can you provide what version of python-bugzilla and requests you are using? And probably will be good to see what happens without the proxy.

-arun


----- Original Message -----
> From: "Jani Nikula" <jani.nikula at intel.com>
> To: "Cole Robinson" <crobinso at redhat.com>, python-bugzilla at lists.fedorahosted.org
> Cc: "Josef Stribny" <jstribny at redhat.com>
> Sent: Monday, November 17, 2014 11:21:58 PM
> Subject: Re: [python-bugzilla] [BUG] Server error: buf must be a byte string
> 
> On Sun, 16 Nov 2014, Cole Robinson <crobinso at redhat.com> wrote:
> > On 11/14/2014 04:15 AM, Jani Nikula wrote:
> >>
> >> The command-line client fails with python 2.7.8 as follows:
> >>
> >> Traceback (most recent call last):
> >>    File "/usr/local/bin/bugzilla", line 1253, in <module>
> >>      main()
> >>    File "/usr/local/bin/bugzilla", line 1212, in main
> >>      _do_info(bz, opt)
> >>    File "/usr/local/bin/bugzilla", line 728, in _do_info
> >>      products = bz.getproducts(include_fields=include_fields)
> >>    File "/usr/local/lib/python2.7/dist-packages/bugzilla/base.py", line
> >>    757, in getproducts
> >>      self._products = self._getproducts(**kwargs)
> >>    File "/usr/local/lib/python2.7/dist-packages/bugzilla/base.py", line
> >>    891, in _getproducts
> >>      product_ids = self._proxy.Product.get_accessible_products()
> >>    File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
> >>      return self.__send(self.__name, args)
> >>    File "/usr/local/lib/python2.7/dist-packages/bugzilla/base.py", line
> >>    168, in _ServerProxy__request
> >>      ret = ServerProxy._ServerProxy__request(self, methodname, params)
> >>    File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
> >>      verbose=self.__verbose
> >>    File "/usr/local/lib/python2.7/dist-packages/bugzilla/base.py", line
> >>    263, in request
> >>      return self._request_helper(url, request_body)
> >>    File "/usr/local/lib/python2.7/dist-packages/bugzilla/base.py", line
> >>    250, in _request_helper
> >>      raise e
> >> BugzillaError: buf must be a byte string
> >>
> >> Server error: buf must be a byte string
> >>
> >> I've bisected this to
> >>
> >> commit e3f17d7db5907ea629f31fbc892576fdf9ccec4e
> >> Author: Josef Stribny <jstribny at redhat.com>
> >> Date:   Tue Jun 3 15:27:08 2014 +0200
> >>
> >>      Convert request_body to string for Python 3
> >>
> >> and confirmed that reverting the commit from current master fixes the
> >> issue.
> >>
> >> BR,
> >> Jani.
> >>
> >
> > Thanks for the report. Is this against bugzilla.redhat.com? If not, is it
> > against a public bugzilla instance I can test against? And if so, can you
> > give
> > an example command line that reproduces?
> 
> Seems to be reproducible with simply:
> 
> $ bugzilla info -p
> $ bugzilla --bugzilla=https://bugs.freedesktop.org/xmlrpc.cgi info -p
> $ bugzilla --bugzilla=https://bugzilla.kernel.org/xmlrpc.cgi info -p
> 
> This is behind a proxy; haven't had a chance to try without yet.
> 
> (Not sure if it's related in any way, but some of my scripts doing login
> and bug modification seem to be broken as well. Debugging saga
> continues.)
> 
> BR,
> Jani.
> 
> 
> --
> Jani Nikula, Intel Open Source Technology Center
> _______________________________________________
> python-bugzilla mailing list
> python-bugzilla at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/python-bugzilla
> 


More information about the python-bugzilla mailing list