]> jfr.im git - yt-dlp.git/commitdiff
[http] Fix bug in retrying on read timeout in py < 3.10
authorcoletdjnz <redacted>
Mon, 16 May 2022 21:17:37 +0000 (09:17 +1200)
committercoletdjnz <redacted>
Mon, 16 May 2022 21:17:37 +0000 (09:17 +1200)
socket.timeout is not an alias of TimeoutError in py < 3.10
Fixes bug in https://github.com/yt-dlp/yt-dlp/commit/a2e77303e3385da640a0904cd6cb76235fa9691b
Authored-by: coletdjnz
yt_dlp/downloader/http.py

index 9b7598b1cf39b5b5def7cc6b7c29b8f8aa296fbe..12a2f0cc70fa33461bb5ecf09a5367abf5aa9350 100644 (file)
@@ -1,5 +1,6 @@
 import os
 import random
+import socket
 import ssl
 import time
 
     write_xattr,
 )
 
-RESPONSE_READ_EXCEPTIONS = (TimeoutError, ConnectionError, ssl.SSLError, compat_http_client.HTTPException)
+RESPONSE_READ_EXCEPTIONS = (
+    TimeoutError,
+    socket.timeout,  # compat: py < 3.10
+    ConnectionError,
+    ssl.SSLError,
+    compat_http_client.HTTPException
+)
 
 
 class HttpFD(FileDownloader):