Skip to content

Commit ddf7421

Browse files
xiangyan99fengzhou-msft
authored andcommitted
Bug fix #6690 (#7738)
1 parent 612e430 commit ddf7421

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

sdk/core/azure-core/azure/core/pipeline/transport/aiohttp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,14 @@ async def __anext__(self):
231231
retry_active = False
232232
else:
233233
await asyncio.sleep(retry_interval)
234-
headers = {'range': 'bytes=' + self.downloaded + '-'}
234+
headers = {'range': 'bytes=' + str(self.downloaded) + '-'}
235235
resp = self.pipeline.run(self.request, stream=True, headers=headers)
236236
if resp.status_code == 416:
237237
raise
238238
chunk = await self.response.internal_response.content.read(self.block_size)
239239
if not chunk:
240240
raise StopIteration()
241-
self.downloaded += chunk
241+
self.downloaded += len(chunk)
242242
return chunk
243243
continue
244244
except StreamConsumedError:

sdk/core/azure-core/azure/core/pipeline/transport/requests_asyncio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ async def __anext__(self):
182182
retry_active = False
183183
else:
184184
await asyncio.sleep(retry_interval)
185-
headers = {'range': 'bytes=' + self.downloaded + '-'}
185+
headers = {'range': 'bytes=' + str(self.downloaded) + '-'}
186186
resp = self.pipeline.run(self.request, stream=True, headers=headers)
187187
if resp.status_code == 416:
188188
raise
@@ -193,7 +193,7 @@ async def __anext__(self):
193193
)
194194
if not chunk:
195195
raise StopIteration()
196-
self.downloaded += chunk
196+
self.downloaded += len(chunk)
197197
return chunk
198198
continue
199199
except requests.exceptions.StreamConsumedError:

sdk/core/azure-core/azure/core/pipeline/transport/requests_basic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ def __next__(self):
120120
retry_active = False
121121
else:
122122
time.sleep(retry_interval)
123-
headers = {'range': 'bytes=' + self.downloaded + '-'}
123+
headers = {'range': 'bytes=' + str(self.downloaded) + '-'}
124124
resp = self.pipeline.run(self.request, stream=True, headers=headers)
125125
if resp.status_code == 416:
126126
raise
127127
chunk = next(self.iter_content_func)
128128
if not chunk:
129129
raise StopIteration()
130-
self.downloaded += chunk
130+
self.downloaded += len(chunk)
131131
return chunk
132132
continue
133133
except requests.exceptions.StreamConsumedError:

sdk/core/azure-core/azure/core/pipeline/transport/requests_trio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ async def __anext__(self):
9898
retry_active = False
9999
else:
100100
await trio.sleep(1000)
101-
headers = {'range': 'bytes=' + self.downloaded + '-'}
101+
headers = {'range': 'bytes=' + str(self.downloaded) + '-'}
102102
resp = self.pipeline.run(self.request, stream=True, headers=headers)
103103
if resp.status_code == 416:
104104
raise
@@ -114,7 +114,7 @@ async def __anext__(self):
114114
)
115115
if not chunk:
116116
raise StopIteration()
117-
self.downloaded += chunk
117+
self.downloaded += len(chunk)
118118
return chunk
119119
continue
120120
except requests.exceptions.StreamConsumedError:

0 commit comments

Comments
 (0)