azure-storage-blob 12.23.0__py3-none-any.whl → 12.23.0b1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- azure/storage/blob/_container_client.py +0 -6
- azure/storage/blob/_container_client_helpers.py +2 -7
- azure/storage/blob/_generated/_azure_blob_storage.py +1 -2
- azure/storage/blob/_generated/_serialization.py +0 -2
- azure/storage/blob/_generated/_vendor.py +16 -0
- azure/storage/blob/_generated/aio/_azure_blob_storage.py +1 -2
- azure/storage/blob/_generated/aio/operations/_append_blob_operations.py +7 -1
- azure/storage/blob/_generated/aio/operations/_blob_operations.py +47 -21
- azure/storage/blob/_generated/aio/operations/_block_blob_operations.py +10 -2
- azure/storage/blob/_generated/aio/operations/_container_operations.py +26 -13
- azure/storage/blob/_generated/aio/operations/_page_blob_operations.py +14 -3
- azure/storage/blob/_generated/aio/operations/_service_operations.py +17 -14
- azure/storage/blob/_generated/operations/_append_blob_operations.py +7 -1
- azure/storage/blob/_generated/operations/_blob_operations.py +47 -21
- azure/storage/blob/_generated/operations/_block_blob_operations.py +10 -2
- azure/storage/blob/_generated/operations/_container_operations.py +26 -13
- azure/storage/blob/_generated/operations/_page_blob_operations.py +14 -3
- azure/storage/blob/_generated/operations/_service_operations.py +17 -14
- azure/storage/blob/_shared/base_client.py +0 -2
- azure/storage/blob/_shared/policies.py +9 -8
- azure/storage/blob/_shared/policies_async.py +5 -18
- azure/storage/blob/_version.py +1 -1
- azure/storage/blob/aio/_container_client_async.py +0 -6
- azure/storage/blob/aio/_download_async.py +71 -94
- {azure_storage_blob-12.23.0.dist-info → azure_storage_blob-12.23.0b1.dist-info}/METADATA +2 -2
- {azure_storage_blob-12.23.0.dist-info → azure_storage_blob-12.23.0b1.dist-info}/RECORD +29 -28
- {azure_storage_blob-12.23.0.dist-info → azure_storage_blob-12.23.0b1.dist-info}/WHEEL +1 -1
- {azure_storage_blob-12.23.0.dist-info → azure_storage_blob-12.23.0b1.dist-info}/LICENSE +0 -0
- {azure_storage_blob-12.23.0.dist-info → azure_storage_blob-12.23.0b1.dist-info}/top_level.txt +0 -0
@@ -15,17 +15,17 @@ from azure.core.exceptions import (
|
|
15
15
|
ResourceExistsError,
|
16
16
|
ResourceNotFoundError,
|
17
17
|
ResourceNotModifiedError,
|
18
|
-
StreamClosedError,
|
19
|
-
StreamConsumedError,
|
20
18
|
map_error,
|
21
19
|
)
|
22
20
|
from azure.core.pipeline import PipelineResponse
|
23
|
-
from azure.core.
|
21
|
+
from azure.core.pipeline.transport import HttpResponse
|
22
|
+
from azure.core.rest import HttpRequest
|
24
23
|
from azure.core.tracing.decorator import distributed_trace
|
25
24
|
from azure.core.utils import case_insensitive_dict
|
26
25
|
|
27
26
|
from .. import models as _models
|
28
27
|
from .._serialization import Serializer
|
28
|
+
from .._vendor import _convert_request
|
29
29
|
|
30
30
|
if sys.version_info >= (3, 9):
|
31
31
|
from collections.abc import MutableMapping
|
@@ -427,6 +427,7 @@ class ServiceOperations:
|
|
427
427
|
headers=_headers,
|
428
428
|
params=_params,
|
429
429
|
)
|
430
|
+
_request = _convert_request(_request)
|
430
431
|
_request.url = self._client.format_url(_request.url)
|
431
432
|
|
432
433
|
_stream = False
|
@@ -496,6 +497,7 @@ class ServiceOperations:
|
|
496
497
|
headers=_headers,
|
497
498
|
params=_params,
|
498
499
|
)
|
500
|
+
_request = _convert_request(_request)
|
499
501
|
_request.url = self._client.format_url(_request.url)
|
500
502
|
|
501
503
|
_stream = False
|
@@ -517,7 +519,7 @@ class ServiceOperations:
|
|
517
519
|
response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id"))
|
518
520
|
response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
|
519
521
|
|
520
|
-
deserialized = self._deserialize("StorageServiceProperties", pipeline_response
|
522
|
+
deserialized = self._deserialize("StorageServiceProperties", pipeline_response)
|
521
523
|
|
522
524
|
if cls:
|
523
525
|
return cls(pipeline_response, deserialized, response_headers) # type: ignore
|
@@ -570,6 +572,7 @@ class ServiceOperations:
|
|
570
572
|
headers=_headers,
|
571
573
|
params=_params,
|
572
574
|
)
|
575
|
+
_request = _convert_request(_request)
|
573
576
|
_request.url = self._client.format_url(_request.url)
|
574
577
|
|
575
578
|
_stream = False
|
@@ -592,7 +595,7 @@ class ServiceOperations:
|
|
592
595
|
response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
|
593
596
|
response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
|
594
597
|
|
595
|
-
deserialized = self._deserialize("StorageServiceStats", pipeline_response
|
598
|
+
deserialized = self._deserialize("StorageServiceStats", pipeline_response)
|
596
599
|
|
597
600
|
if cls:
|
598
601
|
return cls(pipeline_response, deserialized, response_headers) # type: ignore
|
@@ -673,6 +676,7 @@ class ServiceOperations:
|
|
673
676
|
headers=_headers,
|
674
677
|
params=_params,
|
675
678
|
)
|
679
|
+
_request = _convert_request(_request)
|
676
680
|
_request.url = self._client.format_url(_request.url)
|
677
681
|
|
678
682
|
_stream = False
|
@@ -694,7 +698,7 @@ class ServiceOperations:
|
|
694
698
|
response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id"))
|
695
699
|
response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
|
696
700
|
|
697
|
-
deserialized = self._deserialize("ListContainersSegmentResponse", pipeline_response
|
701
|
+
deserialized = self._deserialize("ListContainersSegmentResponse", pipeline_response)
|
698
702
|
|
699
703
|
if cls:
|
700
704
|
return cls(pipeline_response, deserialized, response_headers) # type: ignore
|
@@ -757,6 +761,7 @@ class ServiceOperations:
|
|
757
761
|
headers=_headers,
|
758
762
|
params=_params,
|
759
763
|
)
|
764
|
+
_request = _convert_request(_request)
|
760
765
|
_request.url = self._client.format_url(_request.url)
|
761
766
|
|
762
767
|
_stream = False
|
@@ -779,7 +784,7 @@ class ServiceOperations:
|
|
779
784
|
response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
|
780
785
|
response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
|
781
786
|
|
782
|
-
deserialized = self._deserialize("UserDelegationKey", pipeline_response
|
787
|
+
deserialized = self._deserialize("UserDelegationKey", pipeline_response)
|
783
788
|
|
784
789
|
if cls:
|
785
790
|
return cls(pipeline_response, deserialized, response_headers) # type: ignore
|
@@ -830,6 +835,7 @@ class ServiceOperations:
|
|
830
835
|
headers=_headers,
|
831
836
|
params=_params,
|
832
837
|
)
|
838
|
+
_request = _convert_request(_request)
|
833
839
|
_request.url = self._client.format_url(_request.url)
|
834
840
|
|
835
841
|
_stream = False
|
@@ -917,9 +923,9 @@ class ServiceOperations:
|
|
917
923
|
headers=_headers,
|
918
924
|
params=_params,
|
919
925
|
)
|
926
|
+
_request = _convert_request(_request)
|
920
927
|
_request.url = self._client.format_url(_request.url)
|
921
928
|
|
922
|
-
_decompress = kwargs.pop("decompress", True)
|
923
929
|
_stream = True
|
924
930
|
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
925
931
|
_request, stream=_stream, **kwargs
|
@@ -928,10 +934,6 @@ class ServiceOperations:
|
|
928
934
|
response = pipeline_response.http_response
|
929
935
|
|
930
936
|
if response.status_code not in [200]:
|
931
|
-
try:
|
932
|
-
response.read() # Load the body in memory and close the socket
|
933
|
-
except (StreamConsumedError, StreamClosedError):
|
934
|
-
pass
|
935
937
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
936
938
|
error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
|
937
939
|
raise HttpResponseError(response=response, model=error)
|
@@ -941,7 +943,7 @@ class ServiceOperations:
|
|
941
943
|
response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id"))
|
942
944
|
response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
|
943
945
|
|
944
|
-
deserialized = response.stream_download(self._client._pipeline
|
946
|
+
deserialized = response.stream_download(self._client._pipeline)
|
945
947
|
|
946
948
|
if cls:
|
947
949
|
return cls(pipeline_response, deserialized, response_headers) # type: ignore
|
@@ -1023,6 +1025,7 @@ class ServiceOperations:
|
|
1023
1025
|
headers=_headers,
|
1024
1026
|
params=_params,
|
1025
1027
|
)
|
1028
|
+
_request = _convert_request(_request)
|
1026
1029
|
_request.url = self._client.format_url(_request.url)
|
1027
1030
|
|
1028
1031
|
_stream = False
|
@@ -1045,7 +1048,7 @@ class ServiceOperations:
|
|
1045
1048
|
response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
|
1046
1049
|
response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
|
1047
1050
|
|
1048
|
-
deserialized = self._deserialize("FilterBlobSegment", pipeline_response
|
1051
|
+
deserialized = self._deserialize("FilterBlobSegment", pipeline_response)
|
1049
1052
|
|
1050
1053
|
if cls:
|
1051
1054
|
return cls(pipeline_response, deserialized, response_headers) # type: ignore
|
@@ -76,7 +76,6 @@ class StorageAccountHostsMixin(object): # pylint: disable=too-many-instance-att
|
|
76
76
|
self._location_mode = kwargs.get("_location_mode", LocationMode.PRIMARY)
|
77
77
|
self._hosts = kwargs.get("_hosts")
|
78
78
|
self.scheme = parsed_url.scheme
|
79
|
-
self._is_localhost = False
|
80
79
|
|
81
80
|
if service not in ["blob", "queue", "file-share", "dfs"]:
|
82
81
|
raise ValueError(f"Invalid service: {service}")
|
@@ -86,7 +85,6 @@ class StorageAccountHostsMixin(object): # pylint: disable=too-many-instance-att
|
|
86
85
|
self.account_name = account[0] if len(account) > 1 else None
|
87
86
|
if not self.account_name and parsed_url.netloc.startswith("localhost") \
|
88
87
|
or parsed_url.netloc.startswith("127.0.0.1"):
|
89
|
-
self._is_localhost = True
|
90
88
|
self.account_name = parsed_url.path.strip("/")
|
91
89
|
|
92
90
|
self.credential = _format_shared_key_credential(self.account_name, credential)
|
@@ -35,6 +35,11 @@ from .authentication import AzureSigningError, StorageHttpChallenge
|
|
35
35
|
from .constants import DEFAULT_OAUTH_SCOPE
|
36
36
|
from .models import LocationMode
|
37
37
|
|
38
|
+
try:
|
39
|
+
_unicode_type = unicode # type: ignore
|
40
|
+
except NameError:
|
41
|
+
_unicode_type = str
|
42
|
+
|
38
43
|
if TYPE_CHECKING:
|
39
44
|
from azure.core.credentials import TokenCredential
|
40
45
|
from azure.core.pipeline.transport import ( # pylint: disable=non-abstract-transport-import
|
@@ -47,7 +52,7 @@ _LOGGER = logging.getLogger(__name__)
|
|
47
52
|
|
48
53
|
|
49
54
|
def encode_base64(data):
|
50
|
-
if isinstance(data,
|
55
|
+
if isinstance(data, _unicode_type):
|
51
56
|
data = data.encode('utf-8')
|
52
57
|
encoded = base64.b64encode(data)
|
53
58
|
return encoded.decode('utf-8')
|
@@ -90,14 +95,10 @@ def is_retry(response, mode): # pylint: disable=too-many-return-statements
|
|
90
95
|
if status in [501, 505]:
|
91
96
|
return False
|
92
97
|
return True
|
93
|
-
return False
|
94
|
-
|
95
|
-
|
96
|
-
def is_checksum_retry(response):
|
97
98
|
# retry if invalid content md5
|
98
99
|
if response.context.get('validate_content', False) and response.http_response.headers.get('content-md5'):
|
99
100
|
computed_md5 = response.http_request.headers.get('content-md5', None) or \
|
100
|
-
|
101
|
+
encode_base64(StorageContentValidation.get_content_md5(response.http_response.body()))
|
101
102
|
if response.http_response.headers['content-md5'] != computed_md5:
|
102
103
|
return True
|
103
104
|
return False
|
@@ -300,7 +301,7 @@ class StorageResponseHook(HTTPPolicy):
|
|
300
301
|
|
301
302
|
response = self.next.send(request)
|
302
303
|
|
303
|
-
will_retry = is_retry(response, request.context.options.get('mode'))
|
304
|
+
will_retry = is_retry(response, request.context.options.get('mode'))
|
304
305
|
# Auth error could come from Bearer challenge, in which case this request will be made again
|
305
306
|
is_auth_error = response.http_response.status_code == 401
|
306
307
|
should_update_counts = not (will_retry or is_auth_error)
|
@@ -526,7 +527,7 @@ class StorageRetryPolicy(HTTPPolicy):
|
|
526
527
|
while retries_remaining:
|
527
528
|
try:
|
528
529
|
response = self.next.send(request)
|
529
|
-
if is_retry(response, retry_settings['mode'])
|
530
|
+
if is_retry(response, retry_settings['mode']):
|
530
531
|
retries_remaining = self.increment(
|
531
532
|
retry_settings,
|
532
533
|
request=request.http_request,
|
@@ -10,12 +10,12 @@ import logging
|
|
10
10
|
import random
|
11
11
|
from typing import Any, Dict, TYPE_CHECKING
|
12
12
|
|
13
|
-
from azure.core.exceptions import AzureError
|
13
|
+
from azure.core.exceptions import AzureError
|
14
14
|
from azure.core.pipeline.policies import AsyncBearerTokenCredentialPolicy, AsyncHTTPPolicy
|
15
15
|
|
16
16
|
from .authentication import AzureSigningError, StorageHttpChallenge
|
17
17
|
from .constants import DEFAULT_OAUTH_SCOPE
|
18
|
-
from .policies import
|
18
|
+
from .policies import is_retry, StorageRetryPolicy
|
19
19
|
|
20
20
|
if TYPE_CHECKING:
|
21
21
|
from azure.core.credentials_async import AsyncTokenCredential
|
@@ -42,20 +42,6 @@ async def retry_hook(settings, **kwargs):
|
|
42
42
|
**kwargs)
|
43
43
|
|
44
44
|
|
45
|
-
async def is_checksum_retry(response):
|
46
|
-
# retry if invalid content md5
|
47
|
-
if response.context.get('validate_content', False) and response.http_response.headers.get('content-md5'):
|
48
|
-
try:
|
49
|
-
await response.http_response.read() # Load the body in memory and close the socket
|
50
|
-
except (StreamClosedError, StreamConsumedError):
|
51
|
-
pass
|
52
|
-
computed_md5 = response.http_request.headers.get('content-md5', None) or \
|
53
|
-
encode_base64(StorageContentValidation.get_content_md5(response.http_response.content))
|
54
|
-
if response.http_response.headers['content-md5'] != computed_md5:
|
55
|
-
return True
|
56
|
-
return False
|
57
|
-
|
58
|
-
|
59
45
|
class AsyncStorageResponseHook(AsyncHTTPPolicy):
|
60
46
|
|
61
47
|
def __init__(self, **kwargs): # pylint: disable=unused-argument
|
@@ -78,8 +64,9 @@ class AsyncStorageResponseHook(AsyncHTTPPolicy):
|
|
78
64
|
request.context.options.pop('raw_response_hook', self._response_callback)
|
79
65
|
|
80
66
|
response = await self.next.send(request)
|
81
|
-
|
67
|
+
await response.http_response.load_body()
|
82
68
|
|
69
|
+
will_retry = is_retry(response, request.context.options.get('mode'))
|
83
70
|
# Auth error could come from Bearer challenge, in which case this request will be made again
|
84
71
|
is_auth_error = response.http_response.status_code == 401
|
85
72
|
should_update_counts = not (will_retry or is_auth_error)
|
@@ -125,7 +112,7 @@ class AsyncStorageRetryPolicy(StorageRetryPolicy):
|
|
125
112
|
while retries_remaining:
|
126
113
|
try:
|
127
114
|
response = await self.next.send(request)
|
128
|
-
if is_retry(response, retry_settings['mode'])
|
115
|
+
if is_retry(response, retry_settings['mode']):
|
129
116
|
retries_remaining = self.increment(
|
130
117
|
retry_settings,
|
131
118
|
request=request.http_request,
|
azure/storage/blob/_version.py
CHANGED
@@ -1406,8 +1406,6 @@ class ContainerClient(AsyncStorageAccountHostsMixin, StorageAccountHostsMixin, S
|
|
1406
1406
|
"""
|
1407
1407
|
if len(blobs) == 0:
|
1408
1408
|
return AsyncList([])
|
1409
|
-
if self._is_localhost:
|
1410
|
-
kwargs['url_prepend'] = self.account_name
|
1411
1409
|
|
1412
1410
|
reqs, options = _generate_delete_blobs_options(
|
1413
1411
|
self._query_str,
|
@@ -1487,8 +1485,6 @@ class ContainerClient(AsyncStorageAccountHostsMixin, StorageAccountHostsMixin, S
|
|
1487
1485
|
:return: An async iterator of responses, one for each blob in order
|
1488
1486
|
:rtype: asynciterator[~azure.core.pipeline.transport.AsyncHttpResponse]
|
1489
1487
|
"""
|
1490
|
-
if self._is_localhost:
|
1491
|
-
kwargs['url_prepend'] = self.account_name
|
1492
1488
|
reqs, options = _generate_set_tiers_options(
|
1493
1489
|
self._query_str,
|
1494
1490
|
self.container_name,
|
@@ -1548,8 +1544,6 @@ class ContainerClient(AsyncStorageAccountHostsMixin, StorageAccountHostsMixin, S
|
|
1548
1544
|
:return: An async iterator of responses, one for each blob in order
|
1549
1545
|
:rtype: asynciterator[~azure.core.pipeline.transport.AsyncHttpResponse]
|
1550
1546
|
"""
|
1551
|
-
if self._is_localhost:
|
1552
|
-
kwargs['url_prepend'] = self.account_name
|
1553
1547
|
reqs, options = _generate_set_tiers_options(
|
1554
1548
|
self._query_str,
|
1555
1549
|
self.container_name,
|
@@ -19,7 +19,7 @@ from typing import (
|
|
19
19
|
Tuple, TypeVar, Union, TYPE_CHECKING
|
20
20
|
)
|
21
21
|
|
22
|
-
from azure.core.exceptions import
|
22
|
+
from azure.core.exceptions import HttpResponseError
|
23
23
|
|
24
24
|
from .._shared.request_handlers import validate_and_format_range_headers
|
25
25
|
from .._shared.response_handlers import parse_length_from_content_range, process_storage_error
|
@@ -46,8 +46,7 @@ T = TypeVar('T', bytes, str)
|
|
46
46
|
async def process_content(data: Any, start_offset: int, end_offset: int, encryption: Dict[str, Any]) -> bytes:
|
47
47
|
if data is None:
|
48
48
|
raise ValueError("Response cannot be None.")
|
49
|
-
|
50
|
-
content = cast(bytes, data.response.content)
|
49
|
+
content = cast(bytes, data.response.body())
|
51
50
|
if encryption.get('key') is not None or encryption.get('resolver') is not None:
|
52
51
|
try:
|
53
52
|
return decrypt_blob(
|
@@ -121,30 +120,20 @@ class _AsyncChunkDownloader(_ChunkDownloader):
|
|
121
120
|
download_range[1],
|
122
121
|
check_content_md5=self.validate_content
|
123
122
|
)
|
123
|
+
try:
|
124
|
+
_, response = await cast(Awaitable[Any], self.client.download(
|
125
|
+
range=range_header,
|
126
|
+
range_get_content_md5=range_validation,
|
127
|
+
validate_content=self.validate_content,
|
128
|
+
data_stream_total=self.total_size,
|
129
|
+
download_stream_current=self.progress_total,
|
130
|
+
**self.request_options
|
131
|
+
))
|
124
132
|
|
125
|
-
|
126
|
-
|
127
|
-
while retry_active:
|
128
|
-
try:
|
129
|
-
_, response = await cast(Awaitable[Any], self.client.download(
|
130
|
-
range=range_header,
|
131
|
-
range_get_content_md5=range_validation,
|
132
|
-
validate_content=self.validate_content,
|
133
|
-
data_stream_total=self.total_size,
|
134
|
-
download_stream_current=self.progress_total,
|
135
|
-
**self.request_options
|
136
|
-
))
|
137
|
-
except HttpResponseError as error:
|
138
|
-
process_storage_error(error)
|
133
|
+
except HttpResponseError as error:
|
134
|
+
process_storage_error(error)
|
139
135
|
|
140
|
-
|
141
|
-
chunk_data = await process_content(response, offset[0], offset[1], self.encryption_options)
|
142
|
-
retry_active = False
|
143
|
-
except (IncompleteReadError, HttpResponseError, DecodeError) as error:
|
144
|
-
retry_total -= 1
|
145
|
-
if retry_total <= 0:
|
146
|
-
raise HttpResponseError(error, error=error) from error
|
147
|
-
await asyncio.sleep(1)
|
136
|
+
chunk_data = await process_content(response, offset[0], offset[1], self.encryption_options)
|
148
137
|
content_length = response.content_length
|
149
138
|
|
150
139
|
# This makes sure that if_match is set so that we can validate
|
@@ -353,78 +342,66 @@ class StorageStreamDownloader(Generic[T]): # pylint: disable=too-many-instance-
|
|
353
342
|
self._initial_range[1],
|
354
343
|
start_range_required=False,
|
355
344
|
end_range_required=False,
|
356
|
-
check_content_md5=self._validate_content
|
357
|
-
)
|
345
|
+
check_content_md5=self._validate_content)
|
358
346
|
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
#
|
382
|
-
self.
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
elif self._start_range is not None:
|
388
|
-
self.size = self._file_size - self._start_range
|
389
|
-
else:
|
390
|
-
self.size = self._file_size
|
347
|
+
try:
|
348
|
+
location_mode, response = cast(Tuple[Optional[str], Any], await self._clients.blob.download(
|
349
|
+
range=range_header,
|
350
|
+
range_get_content_md5=range_validation,
|
351
|
+
validate_content=self._validate_content,
|
352
|
+
data_stream_total=None,
|
353
|
+
download_stream_current=0,
|
354
|
+
**self._request_options))
|
355
|
+
|
356
|
+
# Check the location we read from to ensure we use the same one
|
357
|
+
# for subsequent requests.
|
358
|
+
self._location_mode = location_mode
|
359
|
+
|
360
|
+
# Parse the total file size and adjust the download size if ranges
|
361
|
+
# were specified
|
362
|
+
self._file_size = parse_length_from_content_range(response.properties.content_range)
|
363
|
+
if self._file_size is None:
|
364
|
+
raise ValueError("Required Content-Range response header is missing or malformed.")
|
365
|
+
# Remove any extra encryption data size from blob size
|
366
|
+
self._file_size = adjust_blob_size_for_encryption(self._file_size, self._encryption_data)
|
367
|
+
|
368
|
+
if self._end_range is not None and self._start_range is not None:
|
369
|
+
# Use the length unless it is over the end of the file
|
370
|
+
self.size = min(self._file_size - self._start_range, self._end_range - self._start_range + 1)
|
371
|
+
elif self._start_range is not None:
|
372
|
+
self.size = self._file_size - self._start_range
|
373
|
+
else:
|
374
|
+
self.size = self._file_size
|
391
375
|
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
376
|
+
except HttpResponseError as error:
|
377
|
+
if self._start_range is None and error.response and error.status_code == 416:
|
378
|
+
# Get range will fail on an empty file. If the user did not
|
379
|
+
# request a range, do a regular get request in order to get
|
380
|
+
# any properties.
|
381
|
+
try:
|
382
|
+
_, response = cast(Tuple[Optional[Any], Any], await self._clients.blob.download(
|
383
|
+
validate_content=self._validate_content,
|
384
|
+
data_stream_total=0,
|
385
|
+
download_stream_current=0,
|
386
|
+
**self._request_options))
|
387
|
+
except HttpResponseError as e:
|
388
|
+
process_storage_error(e)
|
389
|
+
|
390
|
+
# Set the download size to empty
|
391
|
+
self.size = 0
|
392
|
+
self._file_size = 0
|
393
|
+
else:
|
394
|
+
process_storage_error(error)
|
411
395
|
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
)
|
422
|
-
retry_active = False
|
423
|
-
except (IncompleteReadError, HttpResponseError, DecodeError) as error:
|
424
|
-
retry_total -= 1
|
425
|
-
if retry_total <= 0:
|
426
|
-
raise HttpResponseError(error, error=error) from error
|
427
|
-
await asyncio.sleep(1)
|
396
|
+
if self.size == 0:
|
397
|
+
self._current_content = b""
|
398
|
+
else:
|
399
|
+
self._current_content = await process_content(
|
400
|
+
response,
|
401
|
+
self._initial_offset[0],
|
402
|
+
self._initial_offset[1],
|
403
|
+
self._encryption_options
|
404
|
+
)
|
428
405
|
self._download_offset += len(self._current_content)
|
429
406
|
self._raw_download_offset += response.content_length
|
430
407
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: azure-storage-blob
|
3
|
-
Version: 12.23.
|
3
|
+
Version: 12.23.0b1
|
4
4
|
Summary: Microsoft Azure Blob Storage Client Library for Python
|
5
5
|
Home-page: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
|
6
6
|
Author: Microsoft Corporation
|
7
7
|
Author-email: ascl@microsoft.com
|
8
8
|
License: MIT License
|
9
9
|
Keywords: azure,azure sdk
|
10
|
-
Classifier: Development Status ::
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
11
11
|
Classifier: Programming Language :: Python
|
12
12
|
Classifier: Programming Language :: Python :: 3 :: Only
|
13
13
|
Classifier: Programming Language :: Python :: 3
|
@@ -3,8 +3,8 @@ azure/storage/blob/_blob_client.py,sha256=VFLd4oyTWawbxD1H7DBMfJHJcJNAUSXR-nzVxt
|
|
3
3
|
azure/storage/blob/_blob_client_helpers.py,sha256=7tfQzgpV-cnwYc4i-lZEr4YibDDkyl5RCPybQtJZ-i0,51905
|
4
4
|
azure/storage/blob/_blob_service_client.py,sha256=AKoFLHYt4pMREIeQQ3k892xs0XRfS6VV73365KLck-I,40366
|
5
5
|
azure/storage/blob/_blob_service_client_helpers.py,sha256=8jNCrF5rsgdJyAJQTdRR_mcOYuDCw4Nt9AirZk2RYUY,997
|
6
|
-
azure/storage/blob/_container_client.py,sha256=
|
7
|
-
azure/storage/blob/_container_client_helpers.py,sha256=
|
6
|
+
azure/storage/blob/_container_client.py,sha256=GKT43Z3PONwHZNTY026Cy4ddl1icYHLkh_QB9sPKK9g,84467
|
7
|
+
azure/storage/blob/_container_client_helpers.py,sha256=Kp77eGkKgTMrFlwdOn_cQs3_jM-qipoQwqdhHRaUdJU,12359
|
8
8
|
azure/storage/blob/_deserialize.py,sha256=VisgOi6WtpfkeOZ9lMcEAiZyg3A6AqR7oZO52WUXaWU,9937
|
9
9
|
azure/storage/blob/_download.py,sha256=nvj_IBZuSQWV1fO2iB0n_LAndv95SRhbscuGmxu9hHE,40069
|
10
10
|
azure/storage/blob/_encryption.py,sha256=yw1T7bw7WWSxi4utqCvbpcDTwiMBdsjw0-Eqvud_Ulc,47238
|
@@ -15,47 +15,48 @@ azure/storage/blob/_quick_query_helper.py,sha256=HO6ufvSEWQSaFJ4CanujE4IN7FYB6y1
|
|
15
15
|
azure/storage/blob/_serialize.py,sha256=5_MsQx2hVJnhNqlxP6_O7rksxEoGJXXSJSG3WIUd-iw,8146
|
16
16
|
azure/storage/blob/_shared_access_signature.py,sha256=VkoKyo5apDnKQ8wuEBp1C6MaKlqDHAZOf5wlqRcqdOA,35354
|
17
17
|
azure/storage/blob/_upload_helpers.py,sha256=-ZpqzST-wFdWqCm_I4oWGLTMQ5N0aYb3RHxaMvmf9Q4,14688
|
18
|
-
azure/storage/blob/_version.py,sha256=
|
18
|
+
azure/storage/blob/_version.py,sha256=Q6fsDbychx6wPqxZrmiA442MB6e6EId7rWNDbWmnhlg,333
|
19
19
|
azure/storage/blob/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
20
20
|
azure/storage/blob/_generated/__init__.py,sha256=J2H2yiFhRSsMCNKUI7gaYFIQ4_AAbWjPtzXdOsHFQFI,835
|
21
|
-
azure/storage/blob/_generated/_azure_blob_storage.py,sha256=
|
21
|
+
azure/storage/blob/_generated/_azure_blob_storage.py,sha256=Xpt7ZrX5n2nN0l5x8EU9tX8H1ZPaK0vOV0GEFNxhYxs,5716
|
22
22
|
azure/storage/blob/_generated/_configuration.py,sha256=PV4kKjbnHhg6nD30e_acUENnsLuEKKjYRHz1VqEk9UQ,2566
|
23
23
|
azure/storage/blob/_generated/_patch.py,sha256=MdyWs5y2w9_vYRWulELR-RV2uRYkjYpdB7nTVz2tVY4,1532
|
24
|
-
azure/storage/blob/_generated/_serialization.py,sha256=
|
24
|
+
azure/storage/blob/_generated/_serialization.py,sha256=UL45pN1JUtWi96uVT5L9kbXGDtWUBHW0r4e2MeHpsKY,78893
|
25
|
+
azure/storage/blob/_generated/_vendor.py,sha256=e3w-rd6okoiCIB8rNMtF0fehAYFWNlshwiwTsIRkEH4,778
|
25
26
|
azure/storage/blob/_generated/py.typed,sha256=dcrsqJrcYfTX-ckLFJMTaj6mD8aDe2u0tkQG-ZYxnEg,26
|
26
27
|
azure/storage/blob/_generated/aio/__init__.py,sha256=J2H2yiFhRSsMCNKUI7gaYFIQ4_AAbWjPtzXdOsHFQFI,835
|
27
|
-
azure/storage/blob/_generated/aio/_azure_blob_storage.py,sha256=
|
28
|
+
azure/storage/blob/_generated/aio/_azure_blob_storage.py,sha256=79r9sIDwid96ZMyrO3u0S4UnfmR3O3g-M8JDmsTULXU,5859
|
28
29
|
azure/storage/blob/_generated/aio/_configuration.py,sha256=Q4jfjKwpMOvSe2gS9lOdvwwsHvVtsJZN37AYrf4ySgg,2576
|
29
30
|
azure/storage/blob/_generated/aio/_patch.py,sha256=MdyWs5y2w9_vYRWulELR-RV2uRYkjYpdB7nTVz2tVY4,1532
|
30
31
|
azure/storage/blob/_generated/aio/operations/__init__.py,sha256=a5HiO2T3KzSSX8reO6fCwbKcwXqd0A6GIeF4t63XmTA,1181
|
31
|
-
azure/storage/blob/_generated/aio/operations/_append_blob_operations.py,sha256=
|
32
|
-
azure/storage/blob/_generated/aio/operations/_blob_operations.py,sha256=
|
33
|
-
azure/storage/blob/_generated/aio/operations/_block_blob_operations.py,sha256=
|
34
|
-
azure/storage/blob/_generated/aio/operations/_container_operations.py,sha256=
|
35
|
-
azure/storage/blob/_generated/aio/operations/_page_blob_operations.py,sha256=
|
32
|
+
azure/storage/blob/_generated/aio/operations/_append_blob_operations.py,sha256=vJwsxrx2W6ZJigTPIiKshqF9uEEGvBdVeczTFOShFIs,37574
|
33
|
+
azure/storage/blob/_generated/aio/operations/_blob_operations.py,sha256=MAf_mMTpX5T6-wKjLcn_dgF4jiwJzW-zhzeTTKsKs94,167651
|
34
|
+
azure/storage/blob/_generated/aio/operations/_block_blob_operations.py,sha256=WPYthyypwq8EfgekTQpMKMIWWd6TM-TOkqW-V4oxrY0,60953
|
35
|
+
azure/storage/blob/_generated/aio/operations/_container_operations.py,sha256=fr2_IzLrRYQ3UakGkwqg4rCrhUdC9s0WJaNOrLvnO-w,91268
|
36
|
+
azure/storage/blob/_generated/aio/operations/_page_blob_operations.py,sha256=_BT4F56xZ8-nkcf9h-SbDIWwExGJ4nXpBWxPikYPFiY,75443
|
36
37
|
azure/storage/blob/_generated/aio/operations/_patch.py,sha256=pYl0jxVFr3Yu0RHRFIgN3NwFrEZr1uL-7xbEXGgJzBw,794
|
37
|
-
azure/storage/blob/_generated/aio/operations/_service_operations.py,sha256=
|
38
|
+
azure/storage/blob/_generated/aio/operations/_service_operations.py,sha256=SUJkK6dCZpVV539AHl_h0CfpKieC4qY9RJ-XcK8oFEI,36029
|
38
39
|
azure/storage/blob/_generated/models/__init__.py,sha256=qOh_WzGPNB7Do1XSXfRosHQJ94zx1G5dVXpZdkNKLuM,6303
|
39
40
|
azure/storage/blob/_generated/models/_azure_blob_storage_enums.py,sha256=o1I_SPnUKEsx2Aec-goLDw6eqZMyTVqFxg7tKpSYg0I,13049
|
40
41
|
azure/storage/blob/_generated/models/_models_py3.py,sha256=JXhdrOvO8VKo_Vhz-cqnXI1gfDf6nkrcBDC7Cz0rL_s,110612
|
41
42
|
azure/storage/blob/_generated/models/_patch.py,sha256=pYl0jxVFr3Yu0RHRFIgN3NwFrEZr1uL-7xbEXGgJzBw,794
|
42
43
|
azure/storage/blob/_generated/operations/__init__.py,sha256=a5HiO2T3KzSSX8reO6fCwbKcwXqd0A6GIeF4t63XmTA,1181
|
43
|
-
azure/storage/blob/_generated/operations/_append_blob_operations.py,sha256=
|
44
|
-
azure/storage/blob/_generated/operations/_blob_operations.py,sha256=
|
45
|
-
azure/storage/blob/_generated/operations/_block_blob_operations.py,sha256=
|
46
|
-
azure/storage/blob/_generated/operations/_container_operations.py,sha256=
|
47
|
-
azure/storage/blob/_generated/operations/_page_blob_operations.py,sha256=
|
44
|
+
azure/storage/blob/_generated/operations/_append_blob_operations.py,sha256=r-BCOjTSNBma3dxqIp26wnaLDmcdADTOI6ONSimW0ew,56245
|
45
|
+
azure/storage/blob/_generated/operations/_blob_operations.py,sha256=fUtRL4dxM_UMLd0TgPXRE7E3oUqNdr_400CDT-gRqrc,233836
|
46
|
+
azure/storage/blob/_generated/operations/_block_blob_operations.py,sha256=PtQDvIhTiY6-MZ2aal2nKO9mCcKTYUPRToKNjbZAi4Q,91756
|
47
|
+
azure/storage/blob/_generated/operations/_container_operations.py,sha256=PjPuxlFz6hO_CeaZYCO7UjuESjg2OoqhXlqZAW9iPGI,128899
|
48
|
+
azure/storage/blob/_generated/operations/_page_blob_operations.py,sha256=TPUQNbsZ8GbOIizKjzc2LwclyZ4la3lRZRSk8TtViO4,112841
|
48
49
|
azure/storage/blob/_generated/operations/_patch.py,sha256=pYl0jxVFr3Yu0RHRFIgN3NwFrEZr1uL-7xbEXGgJzBw,794
|
49
|
-
azure/storage/blob/_generated/operations/_service_operations.py,sha256=
|
50
|
+
azure/storage/blob/_generated/operations/_service_operations.py,sha256=CSR4vFYxQ5AmLlH8KcC8pJplcFDYWDwjtFQt-5MzPvc,49892
|
50
51
|
azure/storage/blob/_shared/__init__.py,sha256=Ohb4NSCuB9VXGEqjU2o9VZ5L98-a7c8KWZvrujnSFk8,1477
|
51
52
|
azure/storage/blob/_shared/authentication.py,sha256=KfUKWkjItNJxUTWNcCNusYfnENy-XbVelHlZM8fWc0Y,9450
|
52
|
-
azure/storage/blob/_shared/base_client.py,sha256=
|
53
|
+
azure/storage/blob/_shared/base_client.py,sha256=m8APWNQ2cbvMFWdR6y8a1iA4h9BxSA-nQ0ovQr2tuwA,18555
|
53
54
|
azure/storage/blob/_shared/base_client_async.py,sha256=z1dyRk2XSurRn69CwKA_lQYC7kRFOMkwhIr-InPP5t8,11918
|
54
55
|
azure/storage/blob/_shared/constants.py,sha256=0TnhBNEaZpVq0vECmLoXWSzCajtn9WOlfOfzbMApRb4,620
|
55
56
|
azure/storage/blob/_shared/models.py,sha256=aDydzgBj2_-WfnlT1-nOhJt-FHxOU8BG0T0K68BejNk,24907
|
56
57
|
azure/storage/blob/_shared/parser.py,sha256=ACpdtwf6lhzmA0ukT3PmxpGVpimVXTy_mMSdixC55R8,1955
|
57
|
-
azure/storage/blob/_shared/policies.py,sha256=
|
58
|
-
azure/storage/blob/_shared/policies_async.py,sha256=
|
58
|
+
azure/storage/blob/_shared/policies.py,sha256=XuoVxFgyXd2-6h-rniGlvUU4-y0SpsjMdwTdVTRSBjw,30899
|
59
|
+
azure/storage/blob/_shared/policies_async.py,sha256=aVLOV8mugAI7K2rWaaBbUkXd_UCfsw9DH08gZtfLp2A,12713
|
59
60
|
azure/storage/blob/_shared/request_handlers.py,sha256=0G9eyzMY_8BlLfHA6jbJF75ENcu3xqZ33bHfSRi9HTM,9755
|
60
61
|
azure/storage/blob/_shared/response_handlers.py,sha256=wqZ1hGRDTwh3GkRB0gPSjgm_7TP2quZc_ex4pYThW-8,9190
|
61
62
|
azure/storage/blob/_shared/shared_access_signature.py,sha256=ov8h9CStKwlfZBtlj54jeckpzuVjYcYvJNKgxQByZ9o,11130
|
@@ -70,15 +71,15 @@ azure/storage/blob/_shared/avro/schema.py,sha256=Z9qcHIEBDbXxkBBs_HYbEWHlZtAbvT3
|
|
70
71
|
azure/storage/blob/aio/__init__.py,sha256=tVgeGWdfxG32uyJxAE32waysCOGt93S_EeuQLJz7vEM,8344
|
71
72
|
azure/storage/blob/aio/_blob_client_async.py,sha256=wx76W_LrUDQ2vqBbgvS3RzKLtrnXbAe2INRtLXjtu2g,180606
|
72
73
|
azure/storage/blob/aio/_blob_service_client_async.py,sha256=3rOewtzrDmjUoYKwM0EBUwYLizqp3KHx71lEHDcN_Yw,41260
|
73
|
-
azure/storage/blob/aio/_container_client_async.py,sha256=
|
74
|
-
azure/storage/blob/aio/_download_async.py,sha256=
|
74
|
+
azure/storage/blob/aio/_container_client_async.py,sha256=uYmMm_jWvui5EXDXeRSkbhYnVLcukiOpt_657w2cwzc,85147
|
75
|
+
azure/storage/blob/aio/_download_async.py,sha256=QnOf6nZRAcYDvziAOXKSmZ9qAIs106mPTWqMks-RefA,36848
|
75
76
|
azure/storage/blob/aio/_encryption_async.py,sha256=spbWeycNMj38H5ynZ03FRtRu0L0tnl1lQn5UJT6HMAY,2518
|
76
77
|
azure/storage/blob/aio/_lease_async.py,sha256=dy4_KZYuIhlxEvYO4GLTKdZz4UzFkpxcm7zfino6geE,18638
|
77
78
|
azure/storage/blob/aio/_list_blobs_helper.py,sha256=cbrJcaGVfOvVCcLYd5dGx-jV3JjSvKfDIi2AQjf79qs,9920
|
78
79
|
azure/storage/blob/aio/_models.py,sha256=fdv7OQc6utrGBIS8FSNuBhYK5Q65o1TbKvdeeQaeUOc,8143
|
79
80
|
azure/storage/blob/aio/_upload_helpers.py,sha256=zROsVN6PK2Cn59Ysq08Ide5T1IGG2yH7oK9ZCn5uQXs,14038
|
80
|
-
azure_storage_blob-12.23.
|
81
|
-
azure_storage_blob-12.23.
|
82
|
-
azure_storage_blob-12.23.
|
83
|
-
azure_storage_blob-12.23.
|
84
|
-
azure_storage_blob-12.23.
|
81
|
+
azure_storage_blob-12.23.0b1.dist-info/LICENSE,sha256=_VMkgdgo4ToLE8y1mOAjOKNhd0BnWoYu5r3BVBto6T0,1073
|
82
|
+
azure_storage_blob-12.23.0b1.dist-info/METADATA,sha256=tgrAaS4hQ05OXzOYADD8yCJ-DyR-vgnLBkoszoX2z8c,26241
|
83
|
+
azure_storage_blob-12.23.0b1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
84
|
+
azure_storage_blob-12.23.0b1.dist-info/top_level.txt,sha256=S7DhWV9m80TBzAhOFjxDUiNbKszzoThbnrSz5MpbHSQ,6
|
85
|
+
azure_storage_blob-12.23.0b1.dist-info/RECORD,,
|