Skip to content

Commit e46514d

Browse files
committed
Merge pull request #687 from keflavich/skip_access_denied_alma
Skip Access Denied entries in ALMA lists
2 parents f34d27c + afa4627 commit e46514d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

astroquery/alma/core.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,13 @@ def download_and_extract_files(self, urls, delete=True, regex='.*\.fits$',
613613
"A partially completed download list is "
614614
"in Alma.partial_file_list")
615615
raise ex
616+
except requests.HTTPError as ex:
617+
if ex.response.status_code == 401:
618+
log.info("Access denied to {url}. Skipping to"
619+
" next file".format(url=url))
620+
continue
621+
else:
622+
raise ex
616623

617624
fitsfilelist = self.get_files_from_tarballs([tarball_name],
618625
regex=regex, path=path,

astroquery/alma/tests/test_alma_remote.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class TestAlma:
2525

2626
def setup_class(cls):
2727
pass
28+
# new test server
29+
# this server seems not to serve a help page?
30+
# Alma.archive_url = "https://2016-03.asa-test.alma.cl/aq/"
2831
# starting somewhere between Nov 2015 and Jan 2016, the beta server
2932
# stopped serving the actual data, making all staging attempts break
3033
#Alma.archive_url = 'http://beta.cadc-ccda.hia-iha.nrc-cnrc.gc.ca'

0 commit comments

Comments
 (0)