@@ -375,7 +375,6 @@ def _info_from_object(self, obj, namespaces):
375
375
if isinstance (value , datetime ):
376
376
value = datetime_to_epoch (value )
377
377
s3info [name ] = value
378
-
379
378
if 'urls' in namespaces :
380
379
url = self .client .generate_presigned_url (
381
380
ClientMethod = 'get_object' ,
@@ -387,8 +386,6 @@ def _info_from_object(self, obj, namespaces):
387
386
info ['urls' ] = {
388
387
'download' : url
389
388
}
390
-
391
-
392
389
return info
393
390
394
391
def getinfo (self , path , namespaces = None ):
@@ -483,7 +480,8 @@ def openbin(self, path, mode="r", buffering=-1, **options):
483
480
484
481
if _mode .create :
485
482
486
- def on_close (s3file ):
483
+ def on_close_create (s3file ):
484
+ """Called when the S3 file closes, to upload data."""
487
485
try :
488
486
s3file .raw .seek (0 )
489
487
with s3errors (path ):
@@ -503,7 +501,7 @@ def on_close(s3file):
503
501
if info .is_dir :
504
502
raise errors .FileExpected (path )
505
503
506
- s3file = S3File .factory (path , _mode , on_close = on_close )
504
+ s3file = S3File .factory (path , _mode , on_close = on_close_create )
507
505
if _mode .appending :
508
506
try :
509
507
with s3errors (path ):
@@ -522,6 +520,7 @@ def on_close(s3file):
522
520
raise errors .FileExpected (path )
523
521
524
522
def on_close (s3file ):
523
+ """Called when the S3 file closes, to upload the data."""
525
524
try :
526
525
if _mode .writing :
527
526
s3file .raw .seek (0 , os .SEEK_SET )
0 commit comments