Skip to content

Commit

Permalink
Bug fix #6690 (#7738)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyan99 authored Oct 9, 2019
1 parent 13e2962 commit 37cc208
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
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

0 comments on commit 37cc208

Please sign in to comment.