Skip to content

Commit

Permalink
Workaround for joestump#5.
Browse files Browse the repository at this point in the history
  • Loading branch information
espenak committed Oct 21, 2015
1 parent 6c836da commit 5790995
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions transloadit/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@ def _send_request(self, files, **fields):
req.send(body)
errcode, errmsg, headers = req.getreply()
output = req.file.read()
print
print '*' * 70
print
print 'Transloadit output:', output
print
print '*' * 70
print
return json.loads(output)
try:
return json.loads(output)
except json.JSONDecodeError:
# Workaround for https://github.com/joestump/python-transloadit/issues/5
output = '{' + output.split('{', 1)[-1]
return json.loads(output)


def _encode_request(self, fields, files):
body = StringIO()
Expand Down

0 comments on commit 5790995

Please sign in to comment.