Skip to content

Commit

Permalink
fixed formatting of logging command
Browse files Browse the repository at this point in the history
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': <scrapy.crawler.Crawler object at 0x7fdd0528bc50>,
    'redis_key': 'hiplead:start_urls', 'settings':
        <scrapy.settings.Settings object at 0x7fdd00786358>,
    'start_urls': []}
```
  • Loading branch information
carlosp420 committed Dec 27, 2016
1 parent e4a42dd commit f8f5a81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scrapy_redis/spiders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f8f5a81

Please sign in to comment.