williamh / pybugz

Python interface to Bugzilla.
http://www.liquidx.net/pybugz/
GNU General Public License v2.0
80 stars 60 forks source link

binary data in comments makes pybugz crash #83

Open vapier opened 9 years ago

vapier commented 9 years ago

simple to reproduce:

$ bugz get 532044 
 * Using https://bugs.gentoo.org/xmlrpc.cgi 
 * Getting bug 532044 ..
TargetMilestone: ---
OpSystem    : Linux
Updated     : 20141216T10:55:49
See Also    : https://bugs.gentoo.org/show_bug.cgi?id=532508
Reported    : 20141209T10:48:00
Title       : =www-client/pybugz-0.11.1 adds strange char to the stdout
Hardware    : All
Priority    : Normal
Status      : CONFIRMED
Version     : unspecified
classification: Unclassified
AssignedTo  : williamh@gentoo.org
estimated_time: 0.0
Product     : Gentoo Linux
Severity    : normal
Component   : Applications
actual_time : 0.0
remaining_time: 0.0
Reporter    : ago@gentoo.org
Attachments : 0

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.3/bugz", line 70, in <module>
    sys.exit(main())
  File "/usr/lib/python-exec/python3.3/bugz", line 51, in main
    args.func(bugz, args)
  File "/usr/lib64/python3.3/site-packages/bugz/cli.py", line 285, in get
    self.show_bug_info(bug, args.attachments, args.comments)
  File "/usr/lib64/python3.3/site-packages/bugz/cli.py", line 763, in show_bug_info
    bug_comments = self.call_bz(self.bz.Bug.comments, {'ids':[bug['id']]})
  File "/usr/lib64/python3.3/site-packages/bugz/cli.py", line 165, in call_bz
    return method(*self.set_token(*args))
  File "/usr/lib64/python3.3/xmlrpc/client.py", line 1090, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python3.3/xmlrpc/client.py", line 1419, in __request
    verbose=self.__verbose
  File "/usr/lib64/python3.3/site-packages/bugz/bugzilla.py", line 49, in request
    return self.parse_response(resp)
  File "/usr/lib64/python3.3/xmlrpc/client.py", line 1312, in parse_response
    p.feed(data)
  File "/usr/lib64/python3.3/xmlrpc/client.py", line 446, in feed
    self._parser.Parse(data, 0)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 25, column 0

downloading the xml file directly and running through a linter works:

$ curl 'https://bugs.gentoo.org/show_bug.cgi?ctype=xml&id=532044' | xmllint - >/dev/null 
$ echo $?
0