redis 5.2.0__py3-none-any.whl → 5.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
redis/_parsers/helpers.py CHANGED
@@ -396,13 +396,20 @@ def parse_slowlog_get(response, **options):
396
396
  # an O(N) complexity) instead of the command.
397
397
  if isinstance(item[3], list):
398
398
  result["command"] = space.join(item[3])
399
- result["client_address"] = item[4]
400
- result["client_name"] = item[5]
399
+
400
+ # These fields are optional, depends on environment.
401
+ if len(item) >= 6:
402
+ result["client_address"] = item[4]
403
+ result["client_name"] = item[5]
401
404
  else:
402
405
  result["complexity"] = item[3]
403
406
  result["command"] = space.join(item[4])
404
- result["client_address"] = item[5]
405
- result["client_name"] = item[6]
407
+
408
+ # These fields are optional, depends on environment.
409
+ if len(item) >= 7:
410
+ result["client_address"] = item[5]
411
+ result["client_name"] = item[6]
412
+
406
413
  return result
407
414
 
408
415
  return [parse_item(item) for item in response]
@@ -214,7 +214,13 @@ class AbstractConnection:
214
214
  _warnings.warn(
215
215
  f"unclosed Connection {self!r}", ResourceWarning, source=self
216
216
  )
217
- self._close()
217
+
218
+ try:
219
+ asyncio.get_running_loop()
220
+ self._close()
221
+ except RuntimeError:
222
+ # No actions been taken if pool already closed.
223
+ pass
218
224
 
219
225
  def _close(self):
220
226
  """
redis/asyncio/sentinel.py CHANGED
@@ -29,11 +29,7 @@ class SentinelManagedConnection(Connection):
29
29
  super().__init__(**kwargs)
30
30
 
31
31
  def __repr__(self):
32
- pool = self.connection_pool
33
- s = (
34
- f"<{self.__class__.__module__}.{self.__class__.__name__}"
35
- f"(service={pool.service_name}"
36
- )
32
+ s = f"<{self.__class__.__module__}.{self.__class__.__name__}"
37
33
  if self.host:
38
34
  host_info = f",host={self.host},port={self.port}"
39
35
  s += host_info
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: redis
3
- Version: 5.2.0
3
+ Version: 5.2.1
4
4
  Summary: Python client for Redis database and key-value store
5
5
  Home-page: https://github.com/redis/redis-py
6
6
  Author: Redis Inc.
@@ -18,7 +18,7 @@ redis/_parsers/__init__.py,sha256=qkfgV2X9iyvQAvbLdSelwgz0dCk9SGAosCvuZC9-qDc,55
18
18
  redis/_parsers/base.py,sha256=0j3qIhLjQZOzYGc4n1IesNegckomVhvDsEZD6-yb3Ns,7475
19
19
  redis/_parsers/commands.py,sha256=pmR4hl4u93UvCmeDgePHFc6pWDr4slrKEvCsdMmtj_M,11052
20
20
  redis/_parsers/encoders.py,sha256=X0jvTp-E4TZUlZxV5LJJ88TuVrF1vly5tuC0xjxGaSc,1734
21
- redis/_parsers/helpers.py,sha256=XFKGPQUlh5gJfE6D0rJ_qgJDFEKX9aX5vV3NouHv-00,28973
21
+ redis/_parsers/helpers.py,sha256=X5wkGDtuzseeCz23_t3FJpzy1ltIvh7zO1uD3cypiOs,29184
22
22
  redis/_parsers/hiredis.py,sha256=qL1iCkWlxI63PiP99u_MY5-V6zKaesW2fD-IMNtc0QI,8189
23
23
  redis/_parsers/resp2.py,sha256=f22kH-_ZP2iNtOn6xOe65MSy_fJpu8OEn1u_hgeeojI,4813
24
24
  redis/_parsers/resp3.py,sha256=jHtL1LYJegJ_LiNTsjzIvS-kZyNR58jZ_YV4cRfwuN0,11127
@@ -26,10 +26,10 @@ redis/_parsers/socket.py,sha256=CKD8QW_wFSNlIZzxlbNduaGpiv0I8wBcsGuAIojDfJg,5403
26
26
  redis/asyncio/__init__.py,sha256=uoDD8XYVi0Kj6mcufYwLDUTQXmBRx7a0bhKF9stZr7I,1489
27
27
  redis/asyncio/client.py,sha256=WIkebQoxn8GUMv2UmhQ4s81Cal6INwMc5mUohfNSTRk,59630
28
28
  redis/asyncio/cluster.py,sha256=qgBglEl7410K5M1CJxPH1-G3Mv2ed-S134uSJ2mmxng,63177
29
- redis/asyncio/connection.py,sha256=8xn0-RpgHyc3LIM-TjM538QZ0MHv_1j92dNLzD8MJsE,44878
29
+ redis/asyncio/connection.py,sha256=sErywuQxjauJVB5rx2P1AsEKD0T2Z9sTyfzF2ekrIp8,45061
30
30
  redis/asyncio/lock.py,sha256=lLasXEO2E1CskhX5ZZoaSGpmwZP1Q782R3HAUNG3wD4,11967
31
31
  redis/asyncio/retry.py,sha256=SnPPOlo5gcyIFtkC4DY7HFvmDgUaILsJ3DeHioogdB8,2219
32
- redis/asyncio/sentinel.py,sha256=KOfuEsUZjwtL4jVEfpxh8jvzsCbC3fXzjSLiSghs1MY,14397
32
+ redis/asyncio/sentinel.py,sha256=QBpsrdlhZlFqENy_rK1IuasSicox55_xSvP_IywbhbQ,14293
33
33
  redis/asyncio/utils.py,sha256=Yxc5YQumhLjtDDwCS4mgxI6yy2Z21AzLlFxVbxCohic,704
34
34
  redis/commands/__init__.py,sha256=cTUH-MGvaLYS0WuoytyqtN1wniw2A1KbkUXcpvOSY3I,576
35
35
  redis/commands/cluster.py,sha256=BBHSyXfl3OETIJs4JC5DrcfzqgF2Kt4WMEcd0WMILOU,31598
@@ -69,8 +69,8 @@ redis/commands/timeseries/__init__.py,sha256=gkz6wshEzzQQryBOnrAqqQzttS-AHfXmuN_
69
69
  redis/commands/timeseries/commands.py,sha256=8Z2BEyP23qTYCJR_e9zdG11yWmIDwGBMO2PJNLtK2BA,47147
70
70
  redis/commands/timeseries/info.py,sha256=meZYdu7IV9KaUWMKZs9qW4vo3Q9MwhdY-EBtKQzls5o,3223
71
71
  redis/commands/timeseries/utils.py,sha256=NLwSOS5Dz9N8dYQSzEyBIvrItOWwfQ0xgDj8un6x3dU,1319
72
- redis-5.2.0.dist-info/LICENSE,sha256=pXslClvwPXr-VbdAYzE_Ktt7ANVGwKsUmok5gzP-PMg,1074
73
- redis-5.2.0.dist-info/METADATA,sha256=qwgjp9OwwLNWqXHlpONSrTGFiFX1E43jET9K0UNihXU,9138
74
- redis-5.2.0.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
75
- redis-5.2.0.dist-info/top_level.txt,sha256=OMAefszlde6ZoOtlM35AWzpRIrwtcqAMHGlRit-w2-4,6
76
- redis-5.2.0.dist-info/RECORD,,
72
+ redis-5.2.1.dist-info/LICENSE,sha256=pXslClvwPXr-VbdAYzE_Ktt7ANVGwKsUmok5gzP-PMg,1074
73
+ redis-5.2.1.dist-info/METADATA,sha256=BPiJh0sxEzBec911KAZAZ0fbCI4gF46NBvYbMV0Xeco,9138
74
+ redis-5.2.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
75
+ redis-5.2.1.dist-info/top_level.txt,sha256=OMAefszlde6ZoOtlM35AWzpRIrwtcqAMHGlRit-w2-4,6
76
+ redis-5.2.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.44.0)
2
+ Generator: bdist_wheel (0.45.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
File without changes