We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b20fa57 commit 170aad9Copy full SHA for 170aad9
src/multistorageclient/file.py
@@ -114,6 +114,10 @@ def read(self, size: int = -1) -> bytes:
114
data = self._storage_client.read(
115
self._remote_path, byte_range=bytes_range, check_source_version=self._check_source_version
116
)
117
+ # If the storage client is using the Rust client, convert the Rust bytes-like buffer to Python bytes
118
+ # to support Python bytes operations like startswith()
119
+ if self._storage_client._is_rust_client_enabled() and hasattr(data, "to_bytes"):
120
+ data = data.to_bytes()
121
# Update the position by the number of bytes read
122
bytes_read = len(data)
123
self._pos += bytes_read
0 commit comments