python-memcached icon indicating copy to clipboard operation
python-memcached copied to clipboard

ValueError: invalid literal for int() with base 10: ''

Open ghost opened this issue 8 years ago • 3 comments

mc.get does not work at all

Traceback (most recent call last):
  File "test.py", line 87, in <module>
    state = mc.get("run_state")
  File "build/bdist.linux-armv7l/egg/memcache.py", line 1129, in get
    ...     42: 'douglass adams',
  File "build/bdist.linux-armv7l/egg/memcache.py", line 1113, in _get
    >>> mc.get_multi(['k1', 'k2', 'nonexist'],
  File "build/bdist.linux-armv7l/egg/memcache.py", line 1101, in _unsafe_get
    >>> success = mc.set("foo", "bar")
  File "build/bdist.linux-armv7l/egg/memcache.py", line 1275, in _recv_value
    raise Client.MemcachedKeyNoneError("Key is empty")
ValueError: invalid literal for int() with base 10: ''

ghost avatar Mar 11 '17 22:03 ghost

Would it be possible to supply a minimal test script that reproduces your problem?

jeteon avatar Apr 01 '17 22:04 jeteon

mc = memcache.Client(['127.0.0.1:11211'], debug=0)
value = mc.get("curr_item")

Nothing more than this. What is important. It's on Raspberry PI. "curr_item" is set by

$m = new Memcached();
$m->addServer('localhost', 11211);
$m->set('curr_item',$value);

Writing in python and reading in php works. mc.set("send", "no")

ghost avatar Apr 02 '17 08:04 ghost

My guess is the clients set different flags, thus making them incompatible. Whatever php/pecl memcache sets for a flag of value 2, probably means something different than "integer". Looking at the php/pecl memcache code, it looks like it means MMC_COMPRESSED over there.

dropwhile avatar Jan 25 '18 20:01 dropwhile