We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02ae1ea commit c23a860Copy full SHA for c23a860
src/scrapy_redis/connection.py
@@ -1,3 +1,5 @@
1
+import sys
2
+
3
import six
4
5
from scrapy.utils.misc import load_object
@@ -14,6 +16,9 @@
14
16
'REDIS_ENCODING': 'encoding',
15
17
}
18
19
+if sys.version_info > (3,):
20
+ SETTINGS_PARAMS_MAP['REDIS_DECODE_RESPONSES'] = 'decode_responses'
21
22
23
def get_redis_from_settings(settings):
24
"""Returns a redis client instance from given Scrapy settings object.
@@ -47,6 +52,11 @@ def get_redis_from_settings(settings):
47
52
REDIS_PARAMS : dict, optional
48
53
Additional client parameters.
49
54
55
+ Python 3 Only
56
+ ----------------
57
+ REDIS_DECODE_RESPONSES : bool, optional
58
+ Sets the `decode_responses` kwarg in Redis cls ctor
59
50
60
"""
51
61
params = defaults.REDIS_PARAMS.copy()
62
params.update(settings.getdict('REDIS_PARAMS'))
0 commit comments