From f8f5a81b1f39080aae65e5560800dfa8a5c7c113 Mon Sep 17 00:00:00 2001 From: carlosp420 Date: Tue, 27 Dec 2016 14:14:56 -0500 Subject: [PATCH] fixed formatting of logging command This avoids this error when running the redis spider: ```shell --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.5/logging/__init__.py", line 980, in emit msg = self.format(record) File "/usr/lib/python3.5/logging/__init__.py", line 830, in format return fmt.format(record) File "/usr/lib/python3.5/logging/__init__.py", line 567, in format record.message = record.getMessage() File "/usr/lib/python3.5/logging/__init__.py", line 330, in getMessage msg = msg % self.args ValueError: incomplete format ``` more traceback: ```shell Message: "Reading start URLs from redis key '%(redis_key)s' (batch size: %(redis_batch_size)s, encoding: %(redis_encoding)" Arguments: {'redis_encoding': 'utf-8', 'redis_batch_size': 16, 'crawler': , 'redis_key': 'hiplead:start_urls', 'settings': , 'start_urls': []} ``` --- src/scrapy_redis/spiders.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scrapy_redis/spiders.py b/src/scrapy_redis/spiders.py index 68caba19..81606d81 100644 --- a/src/scrapy_redis/spiders.py +++ b/src/scrapy_redis/spiders.py @@ -64,7 +64,7 @@ def setup_redis(self, crawler=None): self.redis_encoding = settings.get('REDIS_ENCODING', defaults.REDIS_ENCODING) self.logger.info("Reading start URLs from redis key '%(redis_key)s' " - "(batch size: %(redis_batch_size)s, encoding: %(redis_encoding)", + "(batch size: %(redis_batch_size)s, encoding: %(redis_encoding)s", self.__dict__) self.server = connection.from_settings(crawler.settings)