mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #4468 from VasiliPupkin256/fix2392
Simple fix for the issue #2392
This commit is contained in:
@@ -23,6 +23,10 @@
|
||||
|
||||
- Streaming responses with ``Response.iter_lines`` or ``Response.iter_content``
|
||||
now requires an encoding to be set if one isn't provided by the server.
|
||||
|
||||
- Exception raised during read timeout for ``Response.iter_content`` and
|
||||
``Response.iter_lines`` changed from ``ConnectionError`` to more
|
||||
specific ``ReadTimeout``.
|
||||
|
||||
- Raise exception if multiple locations are returned during a redirect.
|
||||
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@ from .cookies import cookiejar_from_dict, get_cookie_header, _copy_cookie_jar
|
||||
from .exceptions import (
|
||||
HTTPError, MissingScheme, InvalidURL, ChunkedEncodingError,
|
||||
ContentDecodingError, ConnectionError, StreamConsumedError,
|
||||
InvalidHeader, InvalidBodyError)
|
||||
InvalidHeader, InvalidBodyError, ReadTimeout)
|
||||
from ._internal_utils import to_native_string, unicode_is_ascii
|
||||
from .utils import (
|
||||
guess_filename, get_auth_from_url, requote_uri,
|
||||
@@ -742,7 +742,7 @@ class Response(object):
|
||||
except DecodeError as e:
|
||||
raise ContentDecodingError(e)
|
||||
except ReadTimeoutError as e:
|
||||
raise ConnectionError(e)
|
||||
raise ReadTimeout(e)
|
||||
else:
|
||||
# Standard file-like object.
|
||||
while True:
|
||||
|
||||
Reference in New Issue
Block a user