Skip to content
Myr

murder the defaults

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 cc4b0b1 · Browse files · 2 files+1 added−25 removed
This commit

State

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

Diff stats

2 files+1 added−25 removed

  • other:+1 added−25 removed

2 files+1 added−25 removed

deleted:requests/defaults.py-21 removed
1# -*- coding: utf-8 -*-23"""4requests.defaults5~~~~~~~~~~~~~~~~~67This module provides the Requests configuration defaults.89Configurations:1011:base_headers: Default HTTP headers.12:max_redirects: Maximum number of redirects allowed within a request.s13:keep_alive: Reuse HTTP Connections?14:max_retries: The number of times a request should be retried in the event of a connection failure.15:pool_maxsize: The maximium size of an HTTP connection pool.16:pool_connections: The number of active HTTP connection pools to use.17:encode_uri: If true, URIs will automatically be percent-encoded.18:trust_env: If true, the surrouding environment will be trusted (environ, netrc).19"""2021SCHEMAS = ['http', 'https']
modified:requests/models.py+1 added-4 removed
25 unmodified lines
26from .packages.urllib3.exceptions import SSLError as _SSLError27from .packages.urllib3.exceptions import HTTPError as _HTTPError28from .packages.urllib3 import connectionpool, poolmanager29from .packages.urllib3.filepost import encode_multipart_formdata30from .defaults import SCHEMAS3031from .exceptions import (32 ConnectionError, HTTPError, RequestException, Timeout, TooManyRedirects,33 URLRequired, SSLError, MissingSchema, InvalidSchema, InvalidURL)34from .utils import (
199 unmodified lines
234235 if not scheme:236 raise MissingSchema("Invalid URL %r: No schema supplied" % url)237238 if not scheme in SCHEMAS:239 raise InvalidSchema("Invalid scheme %r" % scheme)240238 try:239 netloc = netloc.encode('idna').decode('utf-8')240 except UnicodeError:241 raise InvalidURL('URL has an invalid label.')
341 unmodified lines