this is actually not a bug that you can catch, it is just a log and it is displayed because your debug parameter is 1, so turn off the debug parameter. And, as you can see, you still have None from your print, which means that your key does not exist.
Try something like this:
import memcache mc = memcache.Client(['127.0.0.1:11211'], debug=0) try: print mc.get('gfdsgf') except (mc.MemcachedKeyTypeError, mc.MemcachedKeyNoneError, TypeError, mc.MemcachedKeyCharacterError, mc.MemcachedKeyError, mc.MemcachedKeyLengthError, mc.MemcachedStringEncodingError): print 'error'
source share