sphuber / aiida-s3

AiiDA plugin that provides various storage backends that allow using cloud data storage services, such as AWS S3 and Azure Blob Storage.
MIT License
3 stars 2 forks source link

wrong logic of s3 open() #11

Closed rikigigi closed 1 year ago

rikigigi commented 1 year ago

https://github.com/sphuber/aiida-s3/blob/a7eb601b50367954efe8cbd9e059e55adbfe4192/src/aiida_s3/repository/aws_s3.py#L119 before calling the download_fileobj in boto3 library, the code checks in a wrong way that the file exist. It performs the following steps:

Proposed solution: if necessary, the "file exists" operation can be implemented with the head_object call. The open() call should not check that the file exist by calling super().open(key)

sphuber commented 1 year ago

Fixed by #14