Python function post issue with postgresql


#1

In the API, I can post a postgresql function and get a response.body return of:
[
{
“vperson_id”: “57”,
“new”: 0
}
]
This is ok, although vperson_id is of type numeric(10,0).

In Python script, using platform.api.post(_func/myfunc, params) returns the following result.read() string:

result.read() => ‘[{“vperson_id”:“106”,“new”:0}]’

so, ok, this seems the same as above

However:

json.loads() by itself returns:
json.loads() => [{u’new’: 0, u’vperson_id’: u’106’}]

and then bunchify removes the unicode from variable names, but not the data:

bunchify(json.loads(x)) => [Bunch(new=0, vperson_id=u’106’)])

Suggestions on how to read the results so I don’t have the ‘u’ character issue with bunchify or alternative way to convert the result.read into a Python dictionary object?

Thanks,

Mark