Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit 2abb3ad

Browse files
author
Chris Meyers
committed
str() only takes one arg in py2.
1 parent 90f4bda commit 2abb3ad

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

google/datalab/storage/commands/_storage.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,9 @@ def _gcs_read(args, _):
365365

366366
def _gcs_view(args, _):
367367
contents = _get_object_contents(args['object'])
368-
if not isinstance(contents, basestring) or isinstance(contents, bytes):
368+
if not isinstance(contents, basestring):
369+
contents = str(contents)
370+
else if isinstance(contents, bytes)
369371
contents = str(contents, encoding='UTF-8')
370372
lines = contents.splitlines()
371373
head_count = args['head']

0 commit comments

Comments
 (0)