Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit e337748

Browse files
committed
try and configure redirect
1 parent 6428d06 commit e337748

File tree

1 file changed

+4
-3
lines changed
  • src/mvnfeed_modules/mvnfeed-cli-transfer/mvnfeed/cli/transfer

1 file changed

+4
-3
lines changed

src/mvnfeed_modules/mvnfeed-cli-transfer/mvnfeed/cli/transfer/transfer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
5-
5+
import functools
66
import logging
77
import os.path
88
import requests
@@ -279,10 +279,11 @@ def _download_file(from_repository, path, filename, length=16*1024):
279279

280280
try:
281281
with requests.get(url, headers=headers, stream=True) as response:
282+
response.raw.read = functools.partial(response.raw.read, decode_content=True)
282283
with open(filename, 'wb') as file:
283-
shutil.copyfileobj(response.raw, file, length)
284+
shutil.copyfileobj(response.raw, file)
284285
except Exception as ex:
285-
logging.debug('!! exception while downloading (expected): %s', ex)
286+
logging.debug('exception while downloading (expected): %s', ex)
286287

287288
# response = urlopen(request)
288289
# except error.HTTPError as ex:

0 commit comments

Comments
 (0)