[arvados] updated: 2.7.0-6604-g84366e3b48
git repository hosting
git at public.arvados.org
Tue May 21 13:43:26 UTC 2024
Summary of changes:
sdk/python/arvados/arvfile.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
via 84366e3b482e1f649d7a16943bf825212db0a6b2 (commit)
from d022c4d9dbd94ada1f9d0449cd7c9494b90bb518 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 84366e3b482e1f649d7a16943bf825212db0a6b2
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Tue May 21 09:40:26 2024 -0400
21718: if return_memoryview is true, always return memoryview
This makes for more consistent read() and readfrom() behavior.
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/sdk/python/arvados/arvfile.py b/sdk/python/arvados/arvfile.py
index fb3e5da72b..35d2487b0a 100644
--- a/sdk/python/arvados/arvfile.py
+++ b/sdk/python/arvados/arvfile.py
@@ -1107,7 +1107,10 @@ class ArvadosFile(object):
else:
return data[0].tobytes()
else:
- return b''.join(data)
+ if return_memoryview:
+ return memoryview(b''.join(data))
+ else:
+ return b''.join(data)
@must_be_writable
@synchronized
@@ -1289,7 +1292,10 @@ class ArvadosFileReader(ArvadosFileReaderBase):
data.append(rd)
self._filepos += len(rd)
rd = self.arvadosfile.readfrom(self._filepos, config.KEEP_BLOCK_SIZE, num_retries, exact=False, return_memoryview=True)
- return b''.join(data)
+ if self._return_memoryview:
+ return memoryview(b''.join(data))
+ else:
+ return b''.join(data)
else:
data = self.arvadosfile.readfrom(self._filepos, size, num_retries, exact=True, return_memoryview=self._return_memoryview)
self._filepos += len(data)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list