[Buildbot-commits] [Buildbot] #2415: exceptions.TypeError: <buildbot.status.buildset.BuildSetStatus instance at 0x10c502cb0> is not JSON serializable

Buildbot nobody at buildbot.net
Tue Dec 18 01:57:27 UTC 2012


#2415: exceptions.TypeError: <buildbot.status.buildset.BuildSetStatus instance at
0x10c502cb0> is not JSON serializable
--------------------+------------------------
Reporter:  virgilg  |       Owner:
    Type:  defect   |      Status:  new
Priority:  major    |   Milestone:  undecided
 Version:  0.8.5    |  Resolution:
Keywords:           |
--------------------+------------------------

Comment (by dustin):

 Here's the diff (the !BuildSetStatus change is already in master):

 {{{
 #!patch
 From cb9986cce2b5281caa766179814754921f3d5621 Mon Sep 17 00:00:00 2001
 From: "Dustin J. Mitchell" <dustin at mozilla.com>
 Date: Mon, 17 Dec 2012 20:56:06 -0500
 Subject: [PATCH] call item.asDict, if the method exists, in status_push

 ---
  master/buildbot/status/status_push.py |   10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)

 diff --git a/master/buildbot/status/status_push.py
 b/master/buildbot/status/status_push.py
 index 267ff45..e8d3320 100644
 --- a/master/buildbot/status/status_push.py
 +++ b/master/buildbot/status/status_push.py
 @@ -378,10 +378,16 @@ def popChunk(self):

          while True:
              items = self.queue.popChunk(chunkSize)
 +            newitems = []
 +            for item in items:
 +                if hasattr(item, 'asDict'):
 +                    newitems.append(item.asDict())
 +                else:
 +                    newitems.append(item)
              if self.debug:
 -                packets = json.dumps(items, indent=2, sort_keys=True)
 +                packets = json.dumps(newitems, indent=2, sort_keys=True)
              else:
 -                packets = json.dumps(items, separators=(',',':'))
 +                packets = json.dumps(newitems, separators=(',',':'))
              params = {'packets': packets}
              params.update(self.extra_post_params)
              data = urllib.urlencode(params)
 --
 1.7.10

 }}}

-- 
Ticket URL: <http://trac.buildbot.net/ticket/2415#comment:4>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list