Skip to content

numpy arrays cause OverflowError while converting to json #1

@daneos

Description

@daneos

numpy arrays (and any numpy types in general) cannot be parsed to json.

2017-08-31 16:32:54 - (sanic)[ERROR]: Exception occurred while handling uri: "http://localhost:8000/tango/rest/rc3/hosts/10.81.0.103/10000/devices/solaris/pss/0/attributes/bl_04bmpeemxas_state/value"
Traceback (most recent call last):
  File "/home/daneos/miniconda2/envs/sanic_dev/lib/python3.5/site-packages/sanic/app.py", line 471, in handle_request
    response = await response
  File "/home/daneos/miniconda2/envs/sanic_dev/lib/python3.5/asyncio/coroutines.py", line 109, in __next__
    return self.gen.send(None)
  File "/home/daneos/src/maxiv/mtango-py/api/rc3.py", line 274, in attribute_value
    return data if from_alt else json(data)
  File "/home/daneos/miniconda2/envs/sanic_dev/lib/python3.5/site-packages/sanic/response.py", line 244, in json
    return HTTPResponse(json_dumps(body, **kwargs), headers=headers,
OverflowError: Maximum recursion level reached

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions