Skip to content

Commit f5e5367

Browse files
committed
fix unicode thing: content = binary, text = unicode
1 parent 1d7b4a0 commit f5e5367

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

astroquery/alma/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ def _parse_staging_request_page(self, data_list_page):
699699
download_script = self._request('GET', download_script_url,
700700
cache=False)
701701
download_script_target_urls = []
702-
for line in download_script.content.split('\n'):
702+
for line in download_script.text.split('\n'):
703703
if line and line.split() and line.split()[0] == 'wget':
704704
download_script_target_urls.append(line.split()[1].strip('"'))
705705

astroquery/alma/tests/test_alma.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def test_parse_staging_request_page_asdm(monkeypatch):
131131
alma.dataarchive_url = _get_dataarchive_url()
132132
monkeypatch.setattr(alma, '_request', alma_request)
133133

134-
with open(data_path('request_786572566.html'), 'r') as f:
134+
with open(data_path('request_786572566.html'), 'rb') as f:
135135
response = MockResponse(content=f.read())
136136

137137
alma._staging_log = {'data_list_url': 'request_786572566.html'}
@@ -146,7 +146,7 @@ def test_parse_staging_request_page_mous(monkeypatch):
146146
alma.dataarchive_url = _get_dataarchive_url()
147147
monkeypatch.setattr(alma, '_request', alma_request)
148148

149-
with open(data_path('request_786978956.html'), 'r') as f:
149+
with open(data_path('request_786978956.html'), 'rb') as f:
150150
response = MockResponse(content=f.read())
151151

152152
alma._staging_log = {'data_list_url': 'request_786978956.html'}
@@ -162,7 +162,7 @@ def test_parse_staging_request_page_mous_cycle0(monkeypatch):
162162
alma.dataarchive_url = _get_dataarchive_url()
163163
monkeypatch.setattr(alma, '_request', alma_request)
164164

165-
with open(data_path('request_787632764.html'), 'r') as f:
165+
with open(data_path('request_787632764.html'), 'rb') as f:
166166
response = MockResponse(content=f.read())
167167

168168
alma._staging_log = {'data_list_url': 'request_787632764.html'}

0 commit comments

Comments
 (0)