diff --git a/linodecli/plugins/obj/__init__.py b/linodecli/plugins/obj/__init__.py index 9e613ff7a..9fd981b65 100644 --- a/linodecli/plugins/obj/__init__.py +++ b/linodecli/plugins/obj/__init__.py @@ -56,6 +56,7 @@ try: import boto3 + from botocore.config import Config from botocore.exceptions import ClientError HAS_BOTO = True @@ -443,6 +444,16 @@ def _get_boto_client(cluster, access_key, secret_key): aws_secret_access_key=secret_key, region_name=cluster, endpoint_url=BASE_URL_TEMPLATE.format(cluster), + config=Config( + # This addresses an incompatibility between boto3 1.36.x and + # some third-party S3-compatible storage platforms. + # In the future we may want to consider manually computing the + # CRC32 hash of a file before uploading it. + # + # See: https://github.com/boto/boto3/issues/4398#issuecomment-2619946229 + request_checksum_calculation="when_required", + response_checksum_validation="when_required", + ), ) # set this for later use diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index a0f283314..5e5ab8a96 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -186,7 +186,7 @@ def _generate_test_file( @pytest.fixture def generate_test_files( - generate_test_file: Callable[[Optional[str], Optional[str]], Path] + generate_test_file: Callable[[Optional[str], Optional[str]], Path], ): """ Return a function that can generate files with random text. diff --git a/tests/integration/image/test_plugin_image_upload.py b/tests/integration/image/test_plugin_image_upload.py index c81621104..3174986b5 100644 --- a/tests/integration/image/test_plugin_image_upload.py +++ b/tests/integration/image/test_plugin_image_upload.py @@ -19,8 +19,8 @@ # A minimal gzipped image that will be accepted by the API TEST_IMAGE_CONTENT = ( - b"\x1F\x8B\x08\x08\xBD\x5C\x91\x60\x00\x03\x74\x65\x73\x74\x2E\x69" - b"\x6D\x67\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00" + b"\x1f\x8b\x08\x08\xbd\x5c\x91\x60\x00\x03\x74\x65\x73\x74\x2e\x69" + b"\x6d\x67\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00" )