Skip to content
Myr

Merge pull request #1031 from sigmavirus24/master

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

Just a bit of linting

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 5c4aa0b, 68d3949 · Browse files · 4 files+11 added−20 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+11 added−20 removed

  • other:+11 added−20 removed

4 files+11 added−20 removed

modified:requests/adapters.py-4 removed
6 unmodified lines
7This module contains the transport adapters that Requests uses to define8and maintain connections.9"""1011import os11import socket1213from .models import Response15from .auth import HTTPProxyAuth14from .packages.urllib3.poolmanager import PoolManager, proxy_from_url15from .hooks import dispatch_hook16from .compat import urlparse17from .utils import DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers
62 unmodified lines
80 conn.key_file = cert[1]81 else:82 conn.cert_file = cert838684 def build_response(self, req, resp):85 response = Response()8687 # Fallback to None if there's no status_code, for whatever reason.
33 unmodified lines
121 conn = self.poolmanager.connection_from_url(url)122123 return conn124128125 def close(self):126 """Dispose of any internal state.127128 Currently, this just closes the PoolManager, which closes pooled
46 unmodified lines
modified:requests/auth.py+1 added-1 removed
163 unmodified lines
164 # If we have a saved nonce, skip the 401165 if self.last_nonce:166 r.headers['Authorization'] = self.build_digest_header(r.method, r.url)167 r.register_hook('response', self.handle_401)168 return r168 return r
modified:requests/models.py+9 added-13 removed
9 unmodified lines
10import collections11import logging1213from io import BytesIO14from .hooks import dispatch_hook, default_hooks14from .hooks import default_hooks15from .structures import CaseInsensitiveDict16from .status_codes import codes1718from .auth import HTTPBasicAuth, HTTPProxyAuth19from .cookies import cookiejar_from_dict, extract_cookies_to_jar, get_cookie_header18from .auth import HTTPBasicAuth19from .cookies import cookiejar_from_dict, get_cookie_header20from .packages.urllib3.filepost import encode_multipart_formdata21from .exceptions import (22 ConnectionError, HTTPError, RequestException, Timeout, TooManyRedirects,23 URLRequired, SSLError, MissingSchema, InvalidSchema, InvalidURL)21from .exceptions import HTTPError, RequestException, MissingSchema, InvalidURL22from .utils import (25 get_encoding_from_headers, stream_untransfer, guess_filename, requote_uri,26 stream_decode_response_unicode, get_netrc_auth, get_environ_proxies,27 to_key_val_list, DEFAULT_CA_BUNDLE_PATH, parse_header_links, iter_slices,28 guess_json_utf)23 stream_untransfer, guess_filename, requote_uri,24 stream_decode_response_unicode, to_key_val_list, parse_header_links,25 iter_slices, guess_json_utf)26from .compat import (30 cookielib, urlparse, urlunparse, urljoin, urlsplit, urlencode, str, bytes,31 StringIO, is_py2, is_py3, chardet, json, builtin_str, urldefrag, basestring)27 cookielib, urlparse, urlunparse, urlsplit, urlencode, str, bytes, StringIO,28 is_py2, chardet, json, builtin_str, basestring)2930REDIRECT_STATI = (codes.moved, codes.found, codes.other, codes.temporary_moved)31CONTENT_CHUNK_SIZE = 10 * 102432ITER_CHUNK_SIZE = 10 * 1024
348 unmodified lines
381 #: the history of the Request. Any redirect responses will end382 #: up here. The list is sorted from the oldest to the most recent request.383 self.history = []384388385 self.reason = None386387 #: A CookieJar of Cookies the server sent back.388 self.cookies = cookiejar_from_dict({})
183 unmodified lines
modified:requests/utils.py+1 added-2 removed
18 unmodified lines
19from netrc import netrc, NetrcParseError2021from . import __version__22from .compat import parse_http_list as _parse_list_header23from .compat import quote, quote_plus, urlparse, basestring, bytes, str, OrderedDict23from .compat import quote, urlparse, bytes, str, OrderedDict24from .cookies import RequestsCookieJar, cookiejar_from_dict2526_hush_pyflakes = (RequestsCookieJar,)27
225 unmodified lines
253 return value.replace('\\\\', '\\').replace('\\"', '"')254 return value255256257257def dict_from_cookiejar(cj):258 """Returns a key/value dictionary from a CookieJar.259260 :param cj: CookieJar object to extract cookies from.
335 unmodified lines