Skip to content

Commit eae5614

Browse files
authored
Merge pull request #2543 from bsipocz/BUG_duplicated_timeout
BUG: fixing duplicated timeout kwarg in _download_file
2 parents e2f3b5d + 097bf12 commit eae5614

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

astroquery/query.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,7 @@ def _request(self, method, url,
277277
and the server response object, if ``save`` is True and ``return_response_on_save``
278278
is True.
279279
"""
280-
req_kwargs = dict(
281-
params=params,
282-
data=data,
283-
headers=headers,
284-
files=files,
285-
timeout=timeout,
286-
json=json
287-
)
280+
288281
if save:
289282
local_filename = url.split('/')[-1]
290283
if os.name == 'nt':
@@ -296,13 +289,15 @@ def _request(self, method, url,
296289
response = self._download_file(url, local_filepath, cache=cache, timeout=timeout,
297290
continuation=continuation, method=method,
298291
allow_redirects=allow_redirects,
299-
auth=auth, **req_kwargs)
292+
auth=auth, params=params, data=data, headers=headers,
293+
files=files, json=json)
300294
if return_response_on_save:
301295
return local_filepath, response
302296
else:
303297
return local_filepath
304298
else:
305-
query = AstroQuery(method, url, **req_kwargs)
299+
query = AstroQuery(method, url, params=params, data=data, headers=headers,
300+
files=files, timeout=timeout, json=json)
306301
if ((self.cache_location is None) or (not self._cache_active) or (not cache)):
307302
with suspend_cache(self):
308303
response = query.request(self._session, stream=stream,

0 commit comments

Comments
 (0)