Closed jbarragan-bridge closed 1 month ago
Sounds like indeed this case was not covered. Can you open a PR?
Thanks @ddelange , I created PR https://github.com/piskvorky/smart_open/pull/838 to address the issue
I am NOT sure if that is a good solution; please let me know if I should consider another approach. Thanks for all the help!!
@jbarragan-bridge @mpenkov this issue can be closed with 7.0.5 released
Yes, thank you!!
Problem description
We are using smart_open to compress and upload files to s3 without a context manager: e.g.
What is the expected result? The expected result (and the result previous version 7.0.0) is to have the
MultipartWriter.close()
been called to perform a S3 complete multipart upload and see the file uploaded into s3What are you seeing instead? The file is not uploaded and
MultipartWriter.close()
is not called.Steps/code to reproduce the problem
Adding the following tests to test_s3.py (
class MultipartWriterTest
) shows our problem:Versions
This looks to be affecting from v7.0.0 to current version
Please provide the output of:
Probably related to this PR https://github.com/piskvorky/smart_open/pull/786 here:
https://github.com/piskvorky/smart_open/pull/786/files#diff-ba9d790d5607c344a97e86f15b3706586deb24d52d52cdf70b9776e3f3412b69L103
Recommendation
Probably closing both, outer and inner in
FileLikeProxy
will help:I can open a PR if that helps.
Thanks for reading!!
Checklist
Before you create the issue, please make sure you have: