Skip to content
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 retrying incomplete downloads with urllib3 2.x #301

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion s3transfer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def __call__(self, bytes_amount):
import threading

from botocore.compat import six # noqa: F401
from botocore.exceptions import IncompleteReadError
from botocore.exceptions import IncompleteReadError, ResponseStreamingError
from botocore.vendored.requests.packages.urllib3.exceptions import (
ReadTimeoutError,
)
Expand Down Expand Up @@ -624,6 +624,7 @@ def _download_range(
OSError,
ReadTimeoutError,
IncompleteReadError,
ResponseStreamingError,
) as e:
logger.debug(
"Retrying exception caught (%s), "
Expand Down Expand Up @@ -840,6 +841,7 @@ def _get_object(self, bucket, key, filename, extra_args, callback):
OSError,
ReadTimeoutError,
IncompleteReadError,
ResponseStreamingError,
) as e:
# TODO: we need a way to reset the callback if the
# download failed.
Expand Down
7 changes: 6 additions & 1 deletion s3transfer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
import threading
from collections import defaultdict

from botocore.exceptions import IncompleteReadError, ReadTimeoutError
from botocore.exceptions import (
IncompleteReadError,
ReadTimeoutError,
ResponseStreamingError,
)
from botocore.httpchecksum import AwsChunkedWrapper
from botocore.utils import is_s3express_bucket

Expand All @@ -41,6 +45,7 @@
SOCKET_ERROR,
ReadTimeoutError,
IncompleteReadError,
ResponseStreamingError,
)


Expand Down
Loading