Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Added IOError to the list of exceptions to retry in the RetryMiddleware

Pablo Hoffman6f262a198cb0
diff --git a/scrapy/contrib/downloadermiddleware/retry.py b/scrapy/contrib/downloadermiddleware/retry.py
index c8d44dffe..f1ab5ab10 100644
--- a/scrapy/contrib/downloadermiddleware/retry.py
+++ b/scrapy/contrib/downloadermiddleware/retry.py
@@ -30,9 +30,11 @@ from scrapy.conf import settings
class RetryMiddleware(object):
+ # IOError is raised by the HttpCompression middleware when trying to
+ # decompress an empty response
EXCEPTIONS_TO_RETRY = (ServerTimeoutError, UserTimeoutError, DNSLookupError,
ConnectionRefusedError, ConnectionDone, ConnectError,
- ConnectionLost, PartialDownloadError)
+ ConnectionLost, PartialDownloadError, IOError)
def __init__(self):
self.max_retry_times = settings.getint('RETRY_TIMES')