Closed
Description
Decimals aren't handled in client.job.create
.
from decimal import Decimal
from zencoder import Zencoder
client = Zencoder('API_KEY')
client.job.create('s3://bucket/key.mp4',
outputs=[{'width': Decimal(300)}])
…causes:
Traceback (most recent call last):
File "test.py", line 9, in <module>
outputs=[{'width': Decimal(300)}])
File "…/zencoder/core.py", line 350, in create
return self.post(self.base_url, body=json.dumps(data))
File "…/json/__init__.py", line 230, in dumps
return _default_encoder.encode(obj)
File "…/json/encoder.py", line 192, in encode
chunks = self.iterencode(o, _one_shot=True)
File "…/json/encoder.py", line 250, in iterencode
return _iterencode(o, 0)
File "…/json/encoder.py", line 173, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: Decimal('300') is not JSON serializable
I'm retrieving job settings from DynamoDB with boto
and simplejson
which seems to like returning numbers as Decimals.
Metadata
Metadata
Assignees
Labels
No labels