From aac032419e94b5f71e763c130d54d4b6f36caa17 Mon Sep 17 00:00:00 2001 From: Robert DeRose Date: Thu, 17 Mar 2016 17:32:10 -0400 Subject: [PATCH] Handle stats not conforming to the triplet format Addresses issue #92 In Ubuntu's (14.04) version of memecached packaged with the OS the version STAT line contains a fourth value due to a space. This breaks the expected triplet pattern and incorrectly caused an exception. --- pymemcache/client/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pymemcache/client/base.py b/pymemcache/client/base.py index 4eab540..ad845d1 100644 --- a/pymemcache/client/base.py +++ b/pymemcache/client/base.py @@ -699,8 +699,8 @@ class Client(object): else: result[key] = value elif name == b'stats' and line.startswith(b'STAT'): - _, key, value = line.split() - result[key] = value + key_value = line.split() + result[key_value[1]] = key_value[2] else: raise MemcacheUnknownError(line[:32]) except Exception: