Skip to content

Commit d65c685

Browse files
authored
Bump botocore dependency specification (#1292)
1 parent 3eabc88 commit d65c685

File tree

6 files changed

+32
-36
lines changed

6 files changed

+32
-36
lines changed

CHANGES.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
Changes
22
-------
33

4-
2.20.0 (2025-02-13)
4+
2.20.0 (2025-02-19)
55
^^^^^^^^^^^^^^^^^^^
66
* patch `AwsChunkedWrapper.read`
7+
* bump botocore dependency specification
78

89
2.19.0 (2025-01-22)
910
^^^^^^^^^^^^^^^^^^^

aiobotocore/httpchecksum.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
FlexibleChecksumError,
77
_apply_request_header_checksum,
88
base64,
9+
conditionally_calculate_md5,
910
determine_content_length,
1011
logger,
1112
)
@@ -129,7 +130,7 @@ async def handle_checksum_body(
129130
response["context"]["checksum"] = checksum_context
130131
return
131132

132-
logger.info(
133+
logger.debug(
133134
f'Skipping checksum validation. Response did not contain one of the '
134135
f'following algorithms: {algorithms}.'
135136
)
@@ -169,7 +170,10 @@ def apply_request_checksum(request):
169170
if not algorithm:
170171
return
171172

172-
if algorithm["in"] == "header":
173+
if algorithm == "conditional-md5":
174+
# Special case to handle the http checksum required trait
175+
conditionally_calculate_md5(request)
176+
elif algorithm["in"] == "header":
173177
_apply_request_header_checksum(request)
174178
elif algorithm["in"] == "trailer":
175179
_apply_request_trailer_checksum(request)
@@ -213,6 +217,12 @@ def _apply_request_trailer_checksum(request):
213217
# services such as S3 may require the decoded content length
214218
headers["X-Amz-Decoded-Content-Length"] = str(content_length)
215219

220+
if "Content-Length" in headers:
221+
del headers["Content-Length"]
222+
logger.debug(
223+
"Removing the Content-Length header since 'chunked' is specified for Transfer-Encoding."
224+
)
225+
216226
if isinstance(body, (bytes, bytearray)):
217227
body = io.BytesIO(body)
218228

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dynamic = ["version", "readme"]
3232
dependencies = [
3333
"aiohttp >= 3.9.2, < 4.0.0",
3434
"aioitertools >= 0.5.1, < 1.0.0",
35-
"botocore >= 1.36.0, < 1.36.4", # NOTE: When updating, always keep `project.optional-dependencies` aligned
35+
"botocore >= 1.36.20, < 1.36.24", # NOTE: When updating, always keep `project.optional-dependencies` aligned
3636
"python-dateutil >= 2.1, < 3.0.0",
3737
"jmespath >= 0.7.1, < 2.0.0",
3838
"multidict >= 6.0.0, < 7.0.0",
@@ -43,10 +43,10 @@ dependencies = [
4343

4444
[project.optional-dependencies]
4545
awscli = [
46-
"awscli >= 1.37.0, < 1.37.4",
46+
"awscli >= 1.37.20, < 1.37.24",
4747
]
4848
boto3 = [
49-
"boto3 >= 1.36.0, < 1.36.4",
49+
"boto3 >= 1.36.20, < 1.36.24",
5050
]
5151

5252
[project.urls]

tests/boto_tests/unit/test_eventstream.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
EventStreamHeaderParser,
2424
EventStreamMessage,
2525
InvalidHeadersLength,
26-
InvalidPayloadLength,
2726
MessagePrelude,
2827
NoInitialResponseError,
2928
)
@@ -262,17 +261,6 @@
262261
InvalidHeadersLength,
263262
)
264263

265-
# In contrast to the CORRUPTED_PAYLOAD case, this message is otherwise
266-
# well-formed - the checksums match.
267-
INVALID_PAYLOAD_LENGTH = (
268-
b"\x01\x00\x00\x11" # total length
269-
+ b"\x00\x00\x00\x00" # headers length
270-
+ b"\xf4\x08\x61\xc5" # prelude crc
271-
+ b"0" * (16 * 1024**2 + 1) # payload
272-
+ b"\x2a\xb4\xc5\xa5", # message crc
273-
InvalidPayloadLength,
274-
)
275-
276264
# Tuples of encoded messages and their expected exception
277265
NEGATIVE_CASES = [
278266
CORRUPTED_LENGTH,
@@ -281,7 +269,6 @@
281269
CORRUPTED_HEADER_LENGTH,
282270
DUPLICATE_HEADER,
283271
INVALID_HEADERS_LENGTH,
284-
INVALID_PAYLOAD_LENGTH,
285272
]
286273

287274

@@ -349,7 +336,6 @@ def test_all_positive_cases():
349336
"corrupted-headers-length",
350337
"duplicate-headers",
351338
"invalid-headers-length",
352-
"invalid-payload-length",
353339
],
354340
)
355341
def test_negative_cases(encoded, exception):

tests/test_patches.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,7 @@
696696
AWSResponse.text: {'a724100ba9f6d51b333b8fe470fac46376d5044a'},
697697
# httpchecksum.py
698698
handle_checksum_body: {
699-
'898cee7a7a5e5a02af7e0e65dcbb8122257b85df',
700-
'6f15cc120818413e89aac088d130c729ba3d422c',
699+
'040cb48d8ebfb5ca195d41deb55b38d1fcb489f8',
701700
},
702701
_handle_streaming_response: {
703702
'7ce971e012f9d4b04889f0af83f67281ed6a9e6e',
@@ -718,10 +717,10 @@
718717
},
719718
AwsChunkedWrapper.__iter__: {'261e26d1061655555fe3dcb2689d963e43f80fb0'},
720719
apply_request_checksum: {
721-
'94f2d201a07a3831fd55d8ca2f2d75cdb06a9514',
720+
'6d904d118cd9d768935e38a60a73a46c67a8d440',
722721
},
723722
_apply_request_trailer_checksum: {
724-
'28cdf19282be7cd2c99a734831ec4f489648bcc7'
723+
'45f483dd8520bf67616a063bdf6386865aad3591',
725724
},
726725
# retryhandler.py
727726
retryhandler.create_retry_handler: {

uv.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)