diff --git a/util/data_object.py b/util/data_object.py index f8c3cb2ae..10f1bee39 100644 --- a/util/data_object.py +++ b/util/data_object.py @@ -151,9 +151,12 @@ def read(ctx, path, max_size=constants.IIDATA_MAX_SLURP_SIZE): buf = ret['arguments'][2] + # Convert BytesBuffer to string. + ret_val = msi.bytes_buf_to_str(ctx, buf, "") + output = ret_val["arguments"][1] msi.data_obj_close(ctx, handle, 0) - return ''.join(buf.buf[:buf.len]) + return output def copy(ctx, path_org, path_copy, force=True): diff --git a/util/msi.py b/util/msi.py index 42170467c..74bfa7c9f 100644 --- a/util/msi.py +++ b/util/msi.py @@ -111,6 +111,7 @@ def _make_exception(name, message): get_obj_type, GetObjTypeError = make('GetObjType', 'Could not get object type') mod_avu_metadata, ModAVUMetadataError = make('ModAVUMetadata', 'Could not modify AVU metadata') stat_vault, MSIStatVaultError = make("_stat_vault", 'Could not stat file system object in vault.') +bytes_buf_to_str, BytesBufToStr = make('BytesBufToStr', 'Could not write bytes buffer to string') # The file checksum microservice should not be invoked directly. This microservice should be invoked via wrap_file_checksum.r wrapper. file_checksum, FileChecksumError = make("_file_checksum", 'Could not calculate non-persistent checksum of vault file.')