/usr/lib/python2.7/dist-packages/socketio/defaultjson.py is in python-socketio 0.3.6-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ### default json loaders
try:
import simplejson as json
json_decimal_args = {"use_decimal": True} # pragma: no cover
except ImportError:
import json
import decimal
class DecimalEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, decimal.Decimal):
return float(o)
return super(DecimalEncoder, self).default(o)
json_decimal_args = {"cls": DecimalEncoder}
def default_json_dumps(data):
return json.dumps(data, separators=(',', ':'),
**json_decimal_args)
def default_json_loads(data):
return json.loads(data)
|