Skip to content

Commit

Permalink
Merge pull request #91 from korylprince/main
Browse files Browse the repository at this point in the history
Don't try to JSON serialize binary data
  • Loading branch information
grahamgilbert authored Mar 2, 2021
2 parents 42e8b05 + 0100119 commit 25e0b9d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sal_python_pkg/sal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ def serializer(obj):
# for strings, so we don't have to handle them here.
if isinstance(obj, datetime.datetime):
# Make sure everything has been set to offset 0 / UTC time.
obj = obj.astimezone(datetime.timezone.utc).isoformat()
return obj.astimezone(datetime.timezone.utc).isoformat()
elif isinstance(obj, bytes):
return "BINARY DATA"
return obj


Expand Down

0 comments on commit 25e0b9d

Please sign in to comment.