Skip to content

redis报错 redis.exceptions.DataError #2

@notwhy

Description

@notwhy

运行代码出错
Traceback (most recent call last):
File "tspider.py", line 84, in
redis_handle.save_startup_params(args)
File "/Users/whynot/python/TSpider/core/utils/redis_utils.py", line 226, in save_startup_params
self.redis_client.hset(self.h_startup_params, 'tld', args.tld)
File "/Library/Python/2.7/site-packages/redis/client.py", line 2617, in hset
return self.execute_command('HSET', name, key, value)
File "/Library/Python/2.7/site-packages/redis/client.py", line 754, in execute_command
connection.send_command(*args)
File "/Library/Python/2.7/site-packages/redis/connection.py", line 619, in send_command
self.send_packed_command(self.pack_command(*args))
File "/Library/Python/2.7/site-packages/redis/connection.py", line 659, in pack_command
for arg in imap(self.encoder.encode, args):
File "/Library/Python/2.7/site-packages/redis/connection.py", line 113, in encode
raise DataError("Invalid input of type: 'bool'. Convert to a "
redis.exceptions.DataError: Invalid input of type: 'bool'. Convert to a byte, string or number first.
image
简单看了一下 是这个函数出了问题
image
注释掉可运行 redis中有部分数据

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions