projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
77306e8
)
[utils] Strict HTTP responses (Closes #6727)
author
Sergey M․
<dstftw@gmail.com>
Tue, 1 Sep 2015 20:16:04 +0000
(
02:16
+0600)
committer
Sergey M․
<dstftw@gmail.com>
Tue, 1 Sep 2015 20:16:04 +0000
(
02:16
+0600)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index e265c75742b6d22647965e6a0261f24bb4a73a00..b7a423166997766d8903b5697dc764008978bc6b 100644
(file)
--- 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):
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:
hc = http_class(*args, **kwargs)
source_address = ydl_handler._params.get('source_address')
if source_address is not None: