Skip to content
Myr

further remove config

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 2b5aed7 · Browse files · 4 files+19 added−28 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+19 added−28 removed

  • other:+19 added−28 removed

4 files+19 added−28 removed

modified:requests/adapters.py+2 added-2 removed
32 unmodified lines
3334 def __init__(self):35 super(BaseAdapter, self).__init__()3637 # def send(self):38 # raise NotImplementedError37 def send(self):38 raise NotImplementedError3940 def close(self):41 raise NotImplementedError42
132 unmodified lines
modified:requests/defaults.py-15 removed
17 unmodified lines
18:trust_env: If true, the surrouding environment will be trusted (environ, netrc).19"""2021SCHEMAS = ['http', 'https']2223from .utils import default_user_agent2425defaults = dict()2627defaults['base_headers'] = {28 'User-Agent': default_user_agent(),29 'Accept-Encoding': ', '.join(('gzip', 'deflate', 'compress')),30 'Accept': '*/*'31}3233# Consumed at the session level, not connection.34defaults['max_redirects'] = 3035defaults['trust_env'] = True36# defaults['support_http0.9'] = True
modified:requests/sessions.py+9 added-10 removed
10 unmodified lines
1112from copy import deepcopy13from .compat import cookielib14from .cookies import cookiejar_from_dict, remove_cookie_by_name15from .defaults import defaults15from .models import Request16from .hooks import dispatch_hook18from .utils import header_expand, from_key_val_list17from .utils import header_expand, from_key_val_list, default_headers18from .packages.urllib3.poolmanager import PoolManager1920from .compat import urlparse, urljoin21from .adapters import HTTPAdapter
1 unmodified line
23from .utils import requote_uri2425from .status_codes import codes26REDIRECT_STATI = (codes.moved, codes.found, codes.other, codes.temporary_moved)27DEFAULT_REDIRECT_LIMIT = 3028293030def merge_kwargs(local_kwarg, default_kwarg):31 """Merges kwarg dictionaries.3233 If a local key in the dictionary is set to None, it will be removed.
99 unmodified lines
133134135136138139140141142137class Session(SessionMixin):138 """A Requests session."""139140 __attrs__ = [
50 unmodified lines
191192 #: SSL certificate.193 self.cert = cert194201 for (k, v) in list(defaults.items()):202 self.config.setdefault(k, deepcopy(v))195 #: Maximum number of redirects to follow.196 self.max_redirects = DEFAULT_REDIRECT_LIMIT197198 #: Should we trust the environment199 self.trust_env = True200201 self.default_headers = default_headers()202203 # Set up a CookieJar to be used by default204 if isinstance(cookies, cookielib.CookieJar):205 self.cookies = cookies206 else:
154 unmodified lines
modified:requests/utils.py+8 added-1 removed
554 unmodified lines
555 elif _implementation == 'IronPython':556 _implementation_version = platform.python_version() # Complete Guess557 else:558 _implementation_version = 'Unknown'559 559560 try:561 p_system = platform.system()562 p_release = platform.release()563 except IOError:
5 unmodified lines
569 '%s/%s' % (_implementation, _implementation_version),570 '%s/%s' % (p_system, p_release),571 ])572573def default_headers():574 return {575 'User-Agent': default_user_agent(),576 'Accept-Encoding': ', '.join(('gzip', 'deflate', 'compress')),577 'Accept': '*/*'578 }579580581def parse_header_links(value):582 """Return a dict of parsed link headers proxies.583584 i.e. Link: <http:/.../front.jpeg>; rel=front; type="image/jpeg",<http://.../back.jpeg>; rel=back;type="image/jpeg"
63 unmodified lines