aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M. <dstftw@gmail.com>2015-09-02 20:22:59 +0600
committerSergey M. <dstftw@gmail.com>2015-09-02 20:22:59 +0600
commitb17ca9c9459023e6e87ed8c19ca0200355597591 (patch)
tree3ce40a916d067d3d81181df3c089100b3c5422ba /youtube_dl
parent080997b8083fed357061e301ab7f38484b24ded2 (diff)
parente5e78797e6e9873b93e550c32f454bbd5444a4ab (diff)
Merge pull request #6731 from dstftw/strict-http-response
[utils] Strict HTTP responses (Closes #6727)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index e265c7574..b7a423166 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -587,6 +587,11 @@ class ContentTooShortError(Exception):
def _create_http_connection(ydl_handler, http_class, is_https, *args, **kwargs):
+ # Working around python 2 bug (see http://bugs.python.org/issue17849) by limiting
+ # expected HTTP responses to meet HTTP/1.0 or later (see also
+ # https://github.com/rg3/youtube-dl/issues/6727)
+ if sys.version_info < (3, 0):
+ kwargs['strict'] = True
hc = http_class(*args, **kwargs)
source_address = ydl_handler._params.get('source_address')
if source_address is not None: