We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have solved this problem.
This is the solution in Chinese: https://www.cnblogs.com/LanTianYou/p/9204431.html
The solution is to modify the final else-block content in the method "_recv_value" in the python file "memcache.py".
The _recv_value method should be like this:
def _recv_value(self, server, flags, rlen): rlen += 2 # include \r\n buf = server.recv(rlen) if len(buf) != rlen: raise _Error("received %d bytes when expecting %d" % (len(buf), rlen)) if len(buf) == rlen: buf = buf[:-2] # strip \r\n if flags & Client._FLAG_COMPRESSED: buf = self.decompressor(buf) flags &= ~Client._FLAG_COMPRESSED if flags == 0: # Bare bytes val = buf elif flags & Client._FLAG_TEXT: val = buf.decode('utf-8') elif flags & Client._FLAG_INTEGER: val = int(buf) elif flags & Client._FLAG_LONG: if six.PY3: val = int(buf) else: val = long(buf) # noqa: F821 elif flags & Client._FLAG_PICKLE: try: file = BytesIO(buf) unpickler = self.unpickler(file) if self.persistent_load: unpickler.persistent_load = self.persistent_load val = unpickler.load() except Exception as e: self.debuglog('Pickle error: %s\n' % e) return None else: self.debuglog("unknown flags on get: %x\n" % flags) # 注释掉这行 # raise ValueError('Unknown flags on get: %x' % flags) # 设定返回值 val = buf return val
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have solved this problem.
This is the solution in Chinese: https://www.cnblogs.com/LanTianYou/p/9204431.html
The solution is to modify the final else-block content in the method "_recv_value" in the python file "memcache.py".
The _recv_value method should be like this:
The text was updated successfully, but these errors were encountered: