decoding-carelink icon indicating copy to clipboard operation
decoding-carelink copied to clipboard

wont decode page with json/collate - TypeError: datetime.time(0, 0) is not JSON serializable

Open kenstack opened this issue 8 years ago • 1 comments

Im decoding history from a 722 and started to get crashes on decoding the second page. If I turn collate off it decodes just fine. When I turn --collate to get json output I get the following error

File "/usr/lib/python2.7/json/encoder.py", line 177, in default raise TypeError(repr(o) + " is not JSON serializable") TypeError: datetime.time(0, 0) is not JSON serializable

I put some prints into the python code - the offending record is below - all records before that parse just fine

RECORD 18 {'_type': 'ChangeBasalProfile_old_profile', '_description': 'ChangeBasalProfile_old_profile 2016-06-16T18:37:55 head[2], body[145] op[0x08]', 'timestamp': '2016-06-16T18:37:55', '_body': '0030000234000d3a000f2a00122400162400181c001a10001e1c0022260027360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', '_head': '080b', 'rate': 'offset', '_date': '77a5121010'}

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/35254500-wont-decode-page-with-json-collate-typeerror-datetime-time-0-0-is-not-json-serializable?utm_campaign=plugin&utm_content=tracker%2F522759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F522759&utm_medium=issues&utm_source=github).

kenstack avatar Jun 17 '16 13:06 kenstack