MCPcopy Create free account
hub / github.com/aws/aws-cli / _convert_to_bytes

Method _convert_to_bytes

awscli/botocore/awsrequest.py:100–111  ·  view source on GitHub ↗
(self, mixed_buffer)

Source from the content-addressed store, hash-verified

98 return rval
99
100 def _convert_to_bytes(self, mixed_buffer):
101 # Take a list of mixed str/bytes and convert it
102 # all into a single bytestring.
103 # Any str will be encoded as utf-8.
104 bytes_buffer = []
105 for chunk in mixed_buffer:
106 if isinstance(chunk, str):
107 bytes_buffer.append(chunk.encode('utf-8'))
108 else:
109 bytes_buffer.append(chunk)
110 msg = b"\r\n".join(bytes_buffer)
111 return msg
112
113 def _send_output(self, message_body=None, *args, **kwargs):
114 self._buffer.extend((b"", b""))

Callers 1

_send_outputMethod · 0.95

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected