@@ -77,23 +77,12 @@ def _atomic_write(
7777 raise
7878
7979
80- def _put (
81- path : Path ,
82- value : Buffer ,
83- start : int | None = None ,
84- exclusive : bool = False ,
85- ) -> int | None :
80+ def _put (path : Path , value : Buffer , exclusive : bool = False ) -> int :
8681 path .parent .mkdir (parents = True , exist_ok = True )
8782 # write takes any object supporting the buffer protocol
8883 view = value .as_buffer_like ()
89- if start is not None :
90- with path .open ("r+b" ) as f :
91- f .seek (start )
92- f .write (view )
93- return None
94- else :
95- with _atomic_write (path , "wb" , exclusive = exclusive ) as f :
96- return f .write (view )
84+ with _atomic_write (path , "wb" , exclusive = exclusive ) as f :
85+ return f .write (view )
9786
9887
9988class LocalStore (Store ):
@@ -111,14 +100,12 @@ class LocalStore(Store):
111100 ----------
112101 supports_writes
113102 supports_deletes
114- supports_partial_writes
115103 supports_listing
116104 root
117105 """
118106
119107 supports_writes : bool = True
120108 supports_deletes : bool = True
121- supports_partial_writes : bool = True
122109 supports_listing : bool = True
123110
124111 root : Path
@@ -253,19 +240,7 @@ async def _set(self, key: str, value: Buffer, exclusive: bool = False) -> None:
253240 f"LocalStore.set(): `value` must be a Buffer instance. Got an instance of { type (value )} instead."
254241 )
255242 path = self .root / key
256- await asyncio .to_thread (_put , path , value , start = None , exclusive = exclusive )
257-
258- async def set_partial_values (
259- self , key_start_values : Iterable [tuple [str , int , bytes | bytearray | memoryview ]]
260- ) -> None :
261- # docstring inherited
262- self ._check_writable ()
263- args = []
264- for key , start , value in key_start_values :
265- assert isinstance (key , str )
266- path = self .root / key
267- args .append ((_put , path , value , start ))
268- await concurrent_map (args , asyncio .to_thread , limit = None ) # TODO: fix limit
243+ await asyncio .to_thread (_put , path , value , exclusive = exclusive )
269244
270245 async def delete (self , key : str ) -> None :
271246 """
0 commit comments