Skip to content

Commit 73bb5bb

Browse files
committed
Adding comment about bytes coercion in _unpack_batch_response.
1 parent fdb1d23 commit 73bb5bb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gcloud/storage/batch.py

+3
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ def __exit__(self, exc_type, exc_val, exc_tb):
170170
def _unpack_batch_response(response, content):
171171
"""Convert response, content -> [(status, reason, payload)]."""
172172
parser = Parser()
173+
# We coerce to bytes to get consitent concat across
174+
# Py2 and Py3. Percent formatting is insufficient since
175+
# it includes the b in Py3.
173176
if not isinstance(content, six.binary_type):
174177
content = content.encode('utf-8')
175178
content_type = response['content-type']

0 commit comments

Comments
 (0)