Skip to content

incr() and decr() fail #7

@joshourisman

Description

@joshourisman

I'm using django-newcache on top of memcached with python-memcache on Django 1.3. For some reason incr() and decr() always fail with a ValueError saying the key cannot be found, even though get() can find it just fine. Here's a copy and paste from the shell:

>>> cache.set('test', 0)
True
>>> cache.get('test')
0
>>> cache.incr('test')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Users/josho/.virtualenvs/faceuptoit/lib/python2.7/site-packages/newcache.py", line 210, in incr
    raise ValueError("Key '%s' not found" % (key,))
ValueError: Key 'test' not found
>>> cache.decr('test')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Users/josho/.virtualenvs/faceuptoit/lib/python2.7/site-packages/newcache.py", line 216, in decr
    raise ValueError("Key '%s' not found" % (key,))
ValueError: Key 'test' not found
>>> cache.get('test')
0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions