File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
b2sdk/transfer/emerge/planner Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 15
15
from collections import deque
16
16
from math import ceil
17
17
18
+ from b2sdk .exception import InvalidUserInput
18
19
from b2sdk .http_constants import (
19
20
DEFAULT_MAX_PART_SIZE ,
20
21
DEFAULT_MIN_PART_SIZE ,
@@ -94,7 +95,14 @@ def __init__(
94
95
self .min_part_size = min_part_size or DEFAULT_MIN_PART_SIZE
95
96
self .recommended_upload_part_size = recommended_upload_part_size or DEFAULT_RECOMMENDED_UPLOAD_PART_SIZE
96
97
self .max_part_size = max_part_size or DEFAULT_MAX_PART_SIZE
97
- assert self .min_part_size <= self .recommended_upload_part_size <= self .max_part_size
98
+ if self .min_part_size > self .recommended_upload_part_size :
99
+ raise InvalidUserInput (
100
+ f"min_part_size value ({ self .min_part_size } ) exceeding recommended_upload_part_size value ({ self .recommended_upload_part_size } )"
101
+ )
102
+ if self .recommended_upload_part_size > self .max_part_size :
103
+ raise InvalidUserInput (
104
+ f"recommended_upload_part_size value ({ self .recommended_upload_part_size } ) exceeding max_part_size value ({ self .max_part_size } )"
105
+ )
98
106
99
107
@classmethod
100
108
def from_account_info (
Original file line number Diff line number Diff line change
1
+ Replace blank ` assert ` with exception when size values for parts upload are misaligned.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments