Closed atomey closed 2 years ago
Yup... you can't write a file to S3 if it's empty. Gives you an AccessDenied message... I would expect it to create an empty file but perhaps not... Seems like if you open a file handle should also close it afterwards, this is considered best practice. but if you never actually wrote to it, perhaps due to how smart_open works, it never actually opens the file.
I have ServerSide encryption enabled for an S3 bucket. I followed the instructions to register in the configuration using the following:
However when I try to close a file handle created for an object which was created, like:
When I close the file, I immediately get an error like this, taken from botocore's response after trying put_object in smart_open:
This is the bucket policy for reference:
Very odd as this code worked a few days earlier but perhaps I'm missing something. No data is written to the file, so this may explain the issue... I can come up with a simple work around I suppose... i'm just realizing this now as I write this out.