@@ -304,10 +304,10 @@ def _open(
304304 hash , blocks = detail ["fn" ], detail ["blocks" ]
305305 if blocks is True :
306306 # stored file is complete
307- logger .debug ("Opening local copy of %s" % path )
307+ logger .debug ("Opening local copy of %s" , path )
308308 return open (fn , mode )
309309 # TODO: action where partial file exists in read-only cache
310- logger .debug ("Opening partially cached copy of %s" % path )
310+ logger .debug ("Opening partially cached copy of %s" , path )
311311 else :
312312 hash = self ._mapper (path )
313313 fn = os .path .join (self .storage [- 1 ], hash )
@@ -320,7 +320,7 @@ def _open(
320320 "uid" : self .fs .ukey (path ),
321321 }
322322 self ._metadata .update_file (path , detail )
323- logger .debug ("Creating local sparse file for %s" % path )
323+ logger .debug ("Creating local sparse file for %s" , path )
324324
325325 # call target filesystems open
326326 self ._mkcache ()
@@ -343,9 +343,9 @@ def _open(
343343 if "blocksize" in detail :
344344 if detail ["blocksize" ] != f .blocksize :
345345 raise BlocksizeMismatchError (
346- "Cached file must be reopened with same block"
347- " size as original (old: %i, new %i) "
348- "" % ( detail [ "blocksize" ], f .blocksize )
346+ f "Cached file must be reopened with same block"
347+ f" size as original (old: { detail [ 'blocksize' ] } , "
348+ f" new { f .blocksize } )"
349349 )
350350 else :
351351 detail ["blocksize" ] = f .blocksize
@@ -570,7 +570,7 @@ def _make_local_details(self, path):
570570 "uid" : self .fs .ukey (path ),
571571 }
572572 self ._metadata .update_file (path , detail )
573- logger .debug ("Copying %s to local cache" % path )
573+ logger .debug ("Copying %s to local cache" , path )
574574 return fn
575575
576576 def cat (
@@ -627,7 +627,7 @@ def _open(self, path, mode="rb", **kwargs):
627627 detail , fn = detail
628628 _ , blocks = detail ["fn" ], detail ["blocks" ]
629629 if blocks is True :
630- logger .debug ("Opening local copy of %s" % path )
630+ logger .debug ("Opening local copy of %s" , path )
631631
632632 # In order to support downstream filesystems to be able to
633633 # infer the compression from the original filename, like
@@ -639,8 +639,8 @@ def _open(self, path, mode="rb", **kwargs):
639639 return f
640640 else :
641641 raise ValueError (
642- "Attempt to open partially cached file %s "
643- " as a wholly cached file" % path
642+ f "Attempt to open partially cached file { path } "
643+ f" as a wholly cached file"
644644 )
645645 else :
646646 fn = self ._make_local_details (path )
@@ -723,7 +723,7 @@ def _open(self, path, mode="rb", **kwargs):
723723
724724 sha = self ._mapper (path )
725725 fn = os .path .join (self .storage [- 1 ], sha )
726- logger .debug ("Copying %s to local cache" % path )
726+ logger .debug ("Copying %s to local cache" , path )
727727 kwargs ["mode" ] = mode
728728
729729 self ._mkcache ()
0 commit comments