[v2] Move Content-Length validation from urllib3 to botocore - #10622
Draft
aemous wants to merge 3 commits into
Draft
[v2] Move Content-Length validation from urllib3 to botocore#10622aemous wants to merge 3 commits into
aemous wants to merge 3 commits into
Conversation
aemous
marked this pull request as draft
September 9, 2026 14:17
Contributor
Author
|
Keeping this in draft mode until we finalize relevant internal discussions. |
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.
Notes:
urllib3bundled dependency to the next major version. This introduced a regression whereurllib3performsContent-Lengthvalidation instead ofbotocore, causing a different error to be raised instead of botocore'sIncompleteRead. As ofurllib3v2,Content-Lengthvalidation is enforced by default, and there is a config option to opt-out (Enable enforce_content_length by default urllib3/urllib3#2514). botocore'sContent-Lengthvalidation was implemented in 2013 whenurllib3had no support forContent-Lengthvalidation, so botocore built its ownContent-Lengthvalidation. This PR opts out ofurllib3'sContent-Lengthvalidation so this check is handled by botocore (as it was pre-urllib3-v2). This fixes a bug in S3 streaming tostdoutwhen anIncompleteReadis encountered.Description of changes:
enforce_content_length=Falseto urllib3, to opt-out of content-length validation. This bringsContent-Lengthvalidation back tourllib3. This fixes a bug with encountering anIncompleteReadwhile streaming an S3 object tostdout.Description of tests:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.