Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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: 2 additions & 2 deletions sdk/core/azure-core/azure/core/pipeline/transport/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ async def __anext__(self):
retry_active = False
else:
await asyncio.sleep(retry_interval)
headers = {'range': 'bytes=' + self.downloaded + '-'}
headers = {'range': 'bytes=' + str(self.downloaded) + '-'}
resp = self.pipeline.run(self.request, stream=True, headers=headers)
if resp.status_code == 416:
raise
chunk = await self.response.internal_response.content.read(self.block_size)
if not chunk:
raise StopIteration()
self.downloaded += chunk
self.downloaded += len(chunk)
return chunk
continue
except StreamConsumedError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ async def __anext__(self):
retry_active = False
else:
await asyncio.sleep(retry_interval)
headers = {'range': 'bytes=' + self.downloaded + '-'}
headers = {'range': 'bytes=' + str(self.downloaded) + '-'}
resp = self.pipeline.run(self.request, stream=True, headers=headers)
if resp.status_code == 416:
raise
Expand All @@ -193,7 +193,7 @@ async def __anext__(self):
)
if not chunk:
raise StopIteration()
self.downloaded += chunk
self.downloaded += len(chunk)
return chunk
continue
except requests.exceptions.StreamConsumedError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ def __next__(self):
retry_active = False
else:
time.sleep(retry_interval)
headers = {'range': 'bytes=' + self.downloaded + '-'}
headers = {'range': 'bytes=' + str(self.downloaded) + '-'}
resp = self.pipeline.run(self.request, stream=True, headers=headers)
if resp.status_code == 416:
raise
chunk = next(self.iter_content_func)
if not chunk:
raise StopIteration()
self.downloaded += chunk
self.downloaded += len(chunk)
return chunk
continue
except requests.exceptions.StreamConsumedError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async def __anext__(self):
retry_active = False
else:
await trio.sleep(1000)
headers = {'range': 'bytes=' + self.downloaded + '-'}
headers = {'range': 'bytes=' + str(self.downloaded) + '-'}
resp = self.pipeline.run(self.request, stream=True, headers=headers)
if resp.status_code == 416:
raise
Expand All @@ -114,7 +114,7 @@ async def __anext__(self):
)
if not chunk:
raise StopIteration()
self.downloaded += chunk
self.downloaded += len(chunk)
return chunk
continue
except requests.exceptions.StreamConsumedError:
Expand Down