summaryrefslogtreecommitdiff
path: root/redis/connection.py
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2017-07-31 16:05:01 -0400
committerAndy McCurdy <andy@andymccurdy.com>2017-07-31 16:05:01 -0400
commit5dced57b6c74b7a7d2342ff705fa239dfa5a2597 (patch)
tree3d97f3f29eded71dd31a960fc33699af7d644358 /redis/connection.py
parenta3502de93b5d74b28a1a8952515b5775b14c653f (diff)
downloadredis-py-5dced57b6c74b7a7d2342ff705fa239dfa5a2597.tar.gz
added get_encoding() to ConnectionPool
Diffstat (limited to 'redis/connection.py')
-rwxr-xr-xredis/connection.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/redis/connection.py b/redis/connection.py
index 728a627..77eb44d 100755
--- a/redis/connection.py
+++ b/redis/connection.py
@@ -394,6 +394,7 @@ class HiredisParser(BaseParser):
raise response[0]
return response
+
if HIREDIS_AVAILABLE:
DefaultParser = HiredisParser
else:
@@ -955,6 +956,15 @@ class ConnectionPool(object):
self._in_use_connections.add(connection)
return connection
+ def get_encoding(self):
+ "Return information about the encoding settings"
+ kwargs = self.connection_kwargs
+ return {
+ 'encoding': kwargs.get('encoding', 'utf-8'),
+ 'encoding_errors': kwargs.get('encoding_errors', 'strict'),
+ 'decode_responses': kwargs.get('decode_responses', False)
+ }
+
def make_connection(self):
"Create a new connection"
if self._created_connections >= self.max_connections: