Ignore "[Errno 29] Illegal seek" errors which may arise when using "upload_object_via_stream" method#1427
Merged
Kami merged 7 commits intoapache:trunkfrom Feb 17, 2020
Merged
Conversation
That error likely represents a file handler / iterator which doesn't support a seek operation (such as pipe) and in such scenario we simply want to ignore that error.
Codecov Report
@@ Coverage Diff @@
## trunk #1427 +/- ##
==========================================
+ Coverage 86.09% 86.09% +<.01%
==========================================
Files 370 370
Lines 77531 77538 +7
Branches 7656 7657 +1
==========================================
+ Hits 66749 66756 +7
Misses 7883 7883
Partials 2899 2899
Continue to review full report at Codecov.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates
upload_object_via_streammethod so any[Errno 29] Illegal seekerror which is thrown by the underlying_hash_buffered_streamfunction is ignored.Background
It looks like this regression has been inadvertently introduced in 4053779 (#1326 - cc @gvengel - just a heads up).
Some iterators such as PIPEs don't support seeking and in such case
[Errno 29] Illegal seekexception is thrown.In this context such exception is harmless so we should ignore it and proceed with hashing - this change does just that.
Thanks to @perbu for reporting this issue.
Closes #1424.
NOTE: If this change is ever cherry-picked into v2.8.x branch, it will need some additional changes to make it work under Python 2.x (OSEror -> IOError, etc.).