-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix UnseekableStreamError during upload #1853
Conversation
50af86c
to
fe348f0
Compare
fe348f0
to
6cb6119
Compare
Might make sense to move the tests to a separate PR, if they look messy. |
lambda session: | ||
Config(signature_version=UNSIGNED) | ||
if session.get_credentials() is None | ||
else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if session.client('s3', config=None)
would work (it does) and I think it's worth linking the docs in a comment: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html#boto3.session.Session.client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't understand, could you elaborate on that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. The reader knows that config=None can happen but without docs can't know if that call is legal or will crash boto
|
||
class S3UploadProgressTest(unittest.TestCase): | ||
def setUp(self): | ||
self.s3_client = boto3.client('s3', config=botocore.client.Config(signature_version=botocore.UNSIGNED)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice-to-have (not required) config=None
case
Codecov Report
@@ Coverage Diff @@
## master #1853 +/- ##
==========================================
+ Coverage 89.57% 89.77% +0.20%
==========================================
Files 62 62
Lines 7335 7367 +32
==========================================
+ Hits 6570 6614 +44
+ Misses 765 753 -12
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
When boto's put_object() retries it calls seek(0) of Body, which calls progress callback with a negative value. tqdm.update() supports negative values since 4.32.
bd9d4f6
to
e58f720
Compare
Description
When boto's
put_object()
retries it callsseek(0)
of Body, which calls progress callback with a negative value.tqdm.update()
supports negative values since 4.32.TODO
Use this section for work-in-progress pull requests. If you're using this section,
please tag your PR "WIP".