Skip to content

Commit

Permalink
Adding comment about bytes coercion in _unpack_batch_response.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes committed Mar 27, 2015
1 parent fdb1d23 commit 73bb5bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gcloud/storage/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ def __exit__(self, exc_type, exc_val, exc_tb):
def _unpack_batch_response(response, content):
"""Convert response, content -> [(status, reason, payload)]."""
parser = Parser()
# We coerce to bytes to get consitent concat across
# Py2 and Py3. Percent formatting is insufficient since
# it includes the b in Py3.
if not isinstance(content, six.binary_type):
content = content.encode('utf-8')
content_type = response['content-type']
Expand Down

0 comments on commit 73bb5bb

Please sign in to comment.