@@ -375,7 +375,6 @@ def _info_from_object(self, obj, namespaces):
375375 if isinstance (value , datetime ):
376376 value = datetime_to_epoch (value )
377377 s3info [name ] = value
378-
379378 if 'urls' in namespaces :
380379 url = self .client .generate_presigned_url (
381380 ClientMethod = 'get_object' ,
@@ -387,8 +386,6 @@ def _info_from_object(self, obj, namespaces):
387386 info ['urls' ] = {
388387 'download' : url
389388 }
390-
391-
392389 return info
393390
394391 def getinfo (self , path , namespaces = None ):
@@ -483,7 +480,8 @@ def openbin(self, path, mode="r", buffering=-1, **options):
483480
484481 if _mode .create :
485482
486- def on_close (s3file ):
483+ def on_close_create (s3file ):
484+ """Called when the S3 file closes, to upload data."""
487485 try :
488486 s3file .raw .seek (0 )
489487 with s3errors (path ):
@@ -503,7 +501,7 @@ def on_close(s3file):
503501 if info .is_dir :
504502 raise errors .FileExpected (path )
505503
506- s3file = S3File .factory (path , _mode , on_close = on_close )
504+ s3file = S3File .factory (path , _mode , on_close = on_close_create )
507505 if _mode .appending :
508506 try :
509507 with s3errors (path ):
@@ -522,6 +520,7 @@ def on_close(s3file):
522520 raise errors .FileExpected (path )
523521
524522 def on_close (s3file ):
523+ """Called when the S3 file closes, to upload the data."""
525524 try :
526525 if _mode .writing :
527526 s3file .raw .seek (0 , os .SEEK_SET )
0 commit comments