-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle a blank stat value #388
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you be able to also add a unit test that covers this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Thank you!
Awesome, thanks for the fast responses. Any chance for a new release soon that will include this so I can import it into our local company repo from pypi? |
A stat with a blank value makes the .stats() call fail with index error. ``` memcache_connection.stats() File "/lib/python3.6/site-packages/pymemcache/client/base.py", line 741, in stats result = self._fetch_cmd(b'stats', args, False) File "/lib/python3.6/site-packages/pymemcache/client/base.py", line 921, in _fetch_cmd result[key_value[1]] = key_value[2] IndexError: list index out of range ``` The line in question we saw that caused this: ``` b'STAT ep_initfile ' ``` This fixes things to no longer blow up. I chose to use a blank binary string instead of None because I suspect other code might make assumptions about the data being binary strings due to this bug. Co-authored-by: reecepeg <[email protected]>
v3.5.2 has been tagged and released on PyPI. |
A stat with a blank value makes the .stats() call fail with index error. ``` memcache_connection.stats() File "/lib/python3.6/site-packages/pymemcache/client/base.py", line 741, in stats result = self._fetch_cmd(b'stats', args, False) File "/lib/python3.6/site-packages/pymemcache/client/base.py", line 921, in _fetch_cmd result[key_value[1]] = key_value[2] IndexError: list index out of range ``` The line in question we saw that caused this: ``` b'STAT ep_initfile ' ``` This fixes things to no longer blow up. I chose to use a blank binary string instead of None because I suspect other code might make assumptions about the data being binary strings due to this bug. Co-authored-by: reecepeg <[email protected]>
A stat with a blank value makes the .stats() call fail with index error.
The line in question we saw that caused this:
This fixes things to no longer blow up. I chose to use a blank binary string instead of None because I suspect other code might make assumptions about the data being binary strings due to this bug.