@@ -304,10 +304,10 @@ def _open(
304
304
hash , blocks = detail ["fn" ], detail ["blocks" ]
305
305
if blocks is True :
306
306
# stored file is complete
307
- logger .debug ("Opening local copy of %s" % path )
307
+ logger .debug ("Opening local copy of %s" , path )
308
308
return open (fn , mode )
309
309
# 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 )
311
311
else :
312
312
hash = self ._mapper (path )
313
313
fn = os .path .join (self .storage [- 1 ], hash )
@@ -320,7 +320,7 @@ def _open(
320
320
"uid" : self .fs .ukey (path ),
321
321
}
322
322
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 )
324
324
325
325
# call target filesystems open
326
326
self ._mkcache ()
@@ -343,9 +343,9 @@ def _open(
343
343
if "blocksize" in detail :
344
344
if detail ["blocksize" ] != f .blocksize :
345
345
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 } )"
349
349
)
350
350
else :
351
351
detail ["blocksize" ] = f .blocksize
@@ -570,7 +570,7 @@ def _make_local_details(self, path):
570
570
"uid" : self .fs .ukey (path ),
571
571
}
572
572
self ._metadata .update_file (path , detail )
573
- logger .debug ("Copying %s to local cache" % path )
573
+ logger .debug ("Copying %s to local cache" , path )
574
574
return fn
575
575
576
576
def cat (
@@ -627,7 +627,7 @@ def _open(self, path, mode="rb", **kwargs):
627
627
detail , fn = detail
628
628
_ , blocks = detail ["fn" ], detail ["blocks" ]
629
629
if blocks is True :
630
- logger .debug ("Opening local copy of %s" % path )
630
+ logger .debug ("Opening local copy of %s" , path )
631
631
632
632
# In order to support downstream filesystems to be able to
633
633
# infer the compression from the original filename, like
@@ -639,8 +639,8 @@ def _open(self, path, mode="rb", **kwargs):
639
639
return f
640
640
else :
641
641
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"
644
644
)
645
645
else :
646
646
fn = self ._make_local_details (path )
@@ -723,7 +723,7 @@ def _open(self, path, mode="rb", **kwargs):
723
723
724
724
sha = self ._mapper (path )
725
725
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 )
727
727
kwargs ["mode" ] = mode
728
728
729
729
self ._mkcache ()
0 commit comments