Skip to content

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

httpcache: allow to import submodules within packages as HTTPCACHE_DBM_MODULE setting.

Rolando Espinoza La fuentea2602df90b69
diff --git a/scrapy/contrib/httpcache.py b/scrapy/contrib/httpcache.py
index 0891c6355..49e82dc8c 100644
--- a/scrapy/contrib/httpcache.py
+++ b/scrapy/contrib/httpcache.py
@@ -163,7 +163,8 @@ class DbmCacheStorage(object):
def __init__(self, settings):
self.cachedir = data_path(settings['HTTPCACHE_DIR'], createdir=True)
self.expiration_secs = settings.getint('HTTPCACHE_EXPIRATION_SECS')
- self.dbmodule = __import__(settings['HTTPCACHE_DBM_MODULE'])
+ self.dbmodule = __import__(settings['HTTPCACHE_DBM_MODULE'],
+ {}, {}, [''])
self.db = None
def open_spider(self, spider):