Skip to content
Myr

Timeouts for urllib3

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 50279dd · Browse files · 1 file+9 added−1 removed
This commit

State

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

Diff stats

1 file+9 added−1 removed

  • other:+9 added−1 removed

1 file+9 added−1 removed

modified:requests/models.py+9 added-1 removed
18 unmodified lines
19from .hooks import dispatch_hook20from .structures import CaseInsensitiveDict21from .status_codes import codes22from .packages.urllib3.exceptions import MaxRetryError23from .packages.urllib3.exceptions import SSLError as _SSLError24from .packages.urllib3.exceptions import HTTPError as _HTTPError25from .packages.urllib3 import connectionpool, poolmanager26from .exceptions import (27 Timeout, URLRequired, TooManyRedirects, HTTPError, ConnectionError)28from .utils import (
377 unmodified lines
406 redirect=False,407 assert_same_host=False,408 preload_content=prefetch,409 decode_content=False,408 retries=self.config.get('max_retries', 0)410 retries=self.config.get('max_retries', 0),411 timeout=self.timeout,412 )413414415 except MaxRetryError, e:416 if not self.config.get('safe_mode', False):417 raise ConnectionError(e)418 else:419 r = None420421 except (_SSLError, _HTTPError), e:422 if not self.config.get('safe_mode', False):423 raise Timeout('Request timed out.')424425 self._build_response(r)426427 # Response manipulation hook.428 self.response = dispatch_hook('response', self.hooks, self.response)
156 unmodified lines