From a8b6c77a0a0efec31ce1ed7f1544a7ee56319d9d Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Tue, 13 Oct 2020 09:26:53 +0200 Subject: [PATCH] ENH: Support authenticated HTTP(S) access in ORA This uses a newly established helper (from gh-5025). However, while this is working with `git annex get`, it does not with `datalad get` -- unclear why. --- datalad/distributed/ora_remote.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/datalad/distributed/ora_remote.py b/datalad/distributed/ora_remote.py index 7b8a3547cd..14bd48053c 100644 --- a/datalad/distributed/ora_remote.py +++ b/datalad/distributed/ora_remote.py @@ -556,15 +556,8 @@ def get(self, key_path, filename, progress_cb): # to annexremote.dirhash from within IO classes url = self.base_url + "/annex/objects/" + str(key_path) - response = requests.get(url, stream=True) - - with open(filename, 'wb') as dst_file: - bytes_received = 0 - for chunk in response.iter_content(chunk_size=self.buffer_size, - decode_unicode=False): - dst_file.write(chunk) - bytes_received += len(chunk) - progress_cb(bytes_received) + from datalad.utils import download_url + download_url(url, filename, overwrite=True) def handle_errors(func):