diff --git a/almdrlib/client.py b/almdrlib/client.py index 410ad31..bd8fe85 100644 --- a/almdrlib/client.py +++ b/almdrlib/client.py @@ -158,7 +158,7 @@ def __init__(self, name, schema, required=False, session=None): def serialize(self, kwargs, header=None): data = kwargs.pop(self.name, "") - if self._format == 'binary': + if self._format == 'binary' and not isinstance(data, bytes): kwargs['data'] = data.encode() else: kwargs['data'] = data