|
16 | 16 | import itertools |
17 | 17 | import logging |
18 | 18 | import urllib.parse |
19 | | -from collections.abc import Iterator |
| 19 | +from collections.abc import Iterator, MutableSequence |
20 | 20 | from contextlib import contextmanager |
21 | 21 | from datetime import timedelta |
22 | 22 | from io import BytesIO |
|
31 | 31 | from mypy_boto3_s3.literals import BucketLocationConstraintType |
32 | 32 | from mypy_boto3_s3.service_resource import Bucket |
33 | 33 | from mypy_boto3_s3.type_defs import ( |
| 34 | + CompletedPartTypeDef, |
34 | 35 | GetObjectOutputTypeDef, |
35 | 36 | HeadObjectOutputTypeDef, |
36 | 37 | ListMultipartUploadsOutputTypeDef, |
@@ -291,7 +292,7 @@ def readFrom(self, readable: IO[Any]) -> None: |
291 | 292 | Bucket=self.bucket_name, Key=self.file_id, **self.encryption_args |
292 | 293 | ) |
293 | 294 | upload_id = response["UploadId"] |
294 | | - parts = [] |
| 295 | + parts: MutableSequence[CompletedPartTypeDef] = [] |
295 | 296 | try: |
296 | 297 | for part_num in itertools.count(): |
297 | 298 | logger.debug( |
@@ -327,7 +328,7 @@ def readFrom(self, readable: IO[Any]) -> None: |
327 | 328 | # Encryption information is not needed here because the upload was |
328 | 329 | # not started with a checksum. |
329 | 330 | response = self.s3_client.complete_multipart_upload( |
330 | | - Bucket=self.bucket_name, # type: ignore |
| 331 | + Bucket=self.bucket_name, |
331 | 332 | Key=self.file_id, |
332 | 333 | UploadId=upload_id, |
333 | 334 | MultipartUpload={"Parts": parts}, |
|
0 commit comments