@@ -191,29 +191,29 @@ def _is_handled_by_requests(o):
191191 return _is_url (o ) and parse_url (o ).scheme in ['http' , 'https' ]
192192
193193
194- def gen_session (url_params ):
194+ def gen_session (http_params ):
195195 """
196- Generate python-requests session from url_params dict
196+ Generate python-requests session from http_params dict
197197 """
198198 s = None
199- if url_params and type (url_params ) is requests .sessions .Session :
200- s = url_params
199+ if http_params and type (http_params ) is requests .sessions .Session :
200+ s = http_params
201201 else :
202202 s = requests .Session ()
203203 s .stream = True
204204 # Setting accept-encoding to None for backwards compatibility with
205205 # urlopen. ideally we want to allow gzip download
206206 # urlopen doesnt decompress automatically, requests does.
207207 s .headers .update ({'Accept-Encoding' : None })
208- if url_params and type (url_params ) is dict :
209- if url_params .get ('auth' , None ) and not s .auth :
210- s .auth = url_params .get ('auth' )
211- if url_params .get ('verify' , True ) is False and s .verify is not False :
212- s .verify = url_params .get ('verify' )
208+ if http_params and type (http_params ) is dict :
209+ if http_params .get ('auth' , None ) and not s .auth :
210+ s .auth = http_params .get ('auth' )
211+ if http_params .get ('verify' , True ) is False and s .verify is not False :
212+ s .verify = http_params .get ('verify' )
213213 return s
214214
215215
216- def fetch_url (url , url_params = None , skip_requests = False ):
216+ def fetch_url (url , http_params = None , skip_requests = False ):
217217 """
218218 If url is url, first try python-requests else try urllib.
219219 Note if requests library is used, auto gunzip is
@@ -226,7 +226,7 @@ def fetch_url(url, url_params=None, skip_requests=False):
226226 'http://cnn.com'
227227 'file:///home/sky/aaa.csv'
228228
229- url_params : dict or requests.Session(), default None
229+ http_params : dict or requests.Session(), default None
230230 A python dict containing:
231231 'auth': tuple (str, str) eg (unae, pwd)
232232 'auth': Any other auth object accepted by requests
@@ -244,20 +244,20 @@ def fetch_url(url, url_params=None, skip_requests=False):
244244 .. versionadded:: 0.21.0
245245 Raises
246246 ------
247- ValueError if url_params specified without installed python-requests pkg
247+ ValueError if http_params specified without installed python-requests pkg
248248 """
249- if not url_params :
249+ if not http_params :
250250 skip_requests = True
251251 if (not skip_requests ) and \
252252 is_requests_pkg_avail () and \
253253 _is_handled_by_requests (url ):
254- s = gen_session (url_params )
254+ s = gen_session (http_params )
255255 resp = s .get (url )
256256 resp .raise_for_status ()
257257 content_bytes = resp .content
258258 else :
259- if url_params and (skip_requests or not is_requests_pkg_avail ()):
260- msg = 'To utilize url_params , python-requests library is ' + \
259+ if http_params and (skip_requests or not is_requests_pkg_avail ()):
260+ msg = 'To utilize http_params , python-requests library is ' + \
261261 'required but not detected'
262262 raise ValueError (msg )
263263 resp = _urlopen (url )
@@ -266,7 +266,7 @@ def fetch_url(url, url_params=None, skip_requests=False):
266266
267267
268268def get_filepath_or_buffer (filepath_or_buffer , encoding = None ,
269- compression = None , url_params = None ,
269+ compression = None , http_params = None ,
270270 skip_requests = False ):
271271 """
272272 If the filepath_or_buffer is a url, translate and return the buffer.
@@ -281,7 +281,7 @@ def get_filepath_or_buffer(filepath_or_buffer, encoding=None,
281281 compression : str, default None
282282 indicate the compression such as 'gzip'.
283283
284- url_params : dict or requests.Session(), default None
284+ http_params : dict or requests.Session(), default None
285285 A python dict containing:
286286 'auth': tuple (str, str) eg (unae, pwd)
287287 'auth': Any other auth object accepted by requests
@@ -304,13 +304,13 @@ def get_filepath_or_buffer(filepath_or_buffer, encoding=None,
304304
305305 Raises
306306 ------
307- ValueError if url_params specified without installed python-requests pkg
307+ ValueError if http_params specified without installed python-requests pkg
308308 """
309309 filepath_or_buffer = _stringify_path (filepath_or_buffer )
310310
311311 if _is_url (filepath_or_buffer ):
312312 req , content_bytes = fetch_url (filepath_or_buffer ,
313- url_params ,
313+ http_params ,
314314 skip_requests )
315315 reader = BytesIO (content_bytes )
316316 content_encoding = req .headers .get ('Content-Encoding' , None )
0 commit comments