Skip to content

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

py3 fix for ignoring cache controls - map is not a list

Konstantin Lopuhin085fdd628314
diff --git a/scrapy/extensions/httpcache.py b/scrapy/extensions/httpcache.py
index 03ea88a10..a871cc895 100644
--- a/scrapy/extensions/httpcache.py
+++ b/scrapy/extensions/httpcache.py
@@ -41,8 +41,8 @@ class RFC2616Policy(object):
def __init__(self, settings):
self.always_store = settings.getbool('HTTPCACHE_ALWAYS_STORE')
self.ignore_schemes = settings.getlist('HTTPCACHE_IGNORE_SCHEMES')
- self.ignore_response_cache_controls = map(
- to_bytes, settings.getlist('HTTPCACHE_IGNORE_RESPONSE_CACHE_CONTROLS'))
+ self.ignore_response_cache_controls = [to_bytes(cc) for cc in
+ settings.getlist('HTTPCACHE_IGNORE_RESPONSE_CACHE_CONTROLS')]
self._cc_parsed = WeakKeyDictionary()
def _parse_cachecontrol(self, r):