Skip to content

Commit 8a60cd2

Browse files
authored
Merge pull request #2246 from andamian/almafix
Fix to allow html downloads with alma package
2 parents 4f29262 + d2d045a commit 8a60cd2

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

astroquery/alma/core.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -722,11 +722,6 @@ def download_files(self, files, savedir=None, cache=True,
722722
else:
723723
raise(ex)
724724

725-
if 'text/html' in check_filename.headers.get('Content-Type', ''):
726-
raise ValueError("Bad query. This can happen if you "
727-
"attempt to download proprietary "
728-
"data when not logged in")
729-
730725
try:
731726
filename = re.search("filename=(.*)",
732727
check_filename.headers['Content-Disposition']).groups()[0]

astroquery/alma/tests/test_alma_remote.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,3 +649,9 @@ def test_big_download_regression(alma):
649649

650650
# this is a big one that fails
651651
alma.download_files([files['access_url'][3]])
652+
653+
654+
@pytest.mark.remote_data
655+
def test_download_html_file():
656+
result = alma.download_files(['https://almascience.nao.ac.jp/dataPortal/member.uid___A001_X1284_X1353.qa2_report.html'])
657+
assert result

0 commit comments

Comments
 (0)