Skip to content

problem setting a value #85

Open
Open

Description

@k1ltr0

hi,
Im working on linux 12.04 64 bits
and i getting the following error:

File "build/bdist.linux-x86_64/egg/memcache.py", line 704, in set
    return self._set("set", key, val, time, min_compress_len, noreply)
  File "build/bdist.linux-x86_64/egg/memcache.py", line 1024, in _set
    return _unsafe_set()
  File "build/bdist.linux-x86_64/egg/memcache.py", line 998, in _unsafe_set
    store_info = self._val_to_store_info(val, min_compress_len)
  File "build/bdist.linux-x86_64/egg/memcache.py", line 962, in _val_to_store_info
    pickler.dump(val)
  File "/usr/lib/python2.7/pickle.py", line 224, in dump
    self.save(obj)
  File "/usr/lib/python2.7/pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/lib/python2.7/pickle.py", line 600, in save_list
    self._batch_appends(iter(obj))
  File "/usr/lib/python2.7/pickle.py", line 615, in _batch_appends
    save(x)
  File "/usr/lib/python2.7/pickle.py", line 306, in save
    rv = reduce(self.proto)
  File "/usr/lib/python2.7/copy_reg.py", line 77, in _reduce_ex
    raise TypeError("a class that defines __slots__ without "
TypeError: a class that defines __slots__ without defining __getstate__ cannot be pickled

when i run tests i get this :

py27 develop-inst-nodeps: /var/www/boorar.git
py27 installed: The directory '/home/ricardo/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.,coverage==4.0.3,flake8==2.2.4,hacking==0.10.2,mccabe==0.2.1,nose==1.3.7,pbr==1.8.1,pep8==1.5.7,pyflakes==0.8.1,-e git+https://github.com/linsomniac/python-memcached.git@37f55ca4ad94ca4ade30d6be28e1facb79ac3182#egg=python_memcached-master,six==1.10.0,wheel==0.24.0
py27 runtests: PYTHONHASHSEED='4142489713'
py27 runtests: commands[0] | nosetests
...MemCached: while expecting 'DELETED', got unexpected response 'NOT_FOUND'
MemCached: while expecting 'DELETED', got unexpected response 'NOT_FOUND'
....MemCached: while expecting 'STORED', got unexpected response 'SERVER_ERROR object too large for cache'
......MemCached: MemCache: inet:127.0.0.1:11211: test.  Marking dead.
.....MemCached: MemCache: inet:memcached:11211: connection closed in readline().  Marking dead.
MemCached: MemCache: inet:memcached:11211 (dead until 1450219647): connection closed in readline().  Marking dead.
.
----------------------------------------------------------------------
Ran 19 tests in 0.261s

OK
py27 runtests: commands[1] | python -c import memcache; memcache._doctest()
Doctests: TestResults(failed=0, attempted=19)
_______________________________________________ summary ________________________________________________
  py27: commands succeeded
  congratulations :)

and this is my code:

import traceback
from memcache import Client

mc = Client(servers=['localhost:8000'])

try:
    # key = "0_acf2c7795a8d7fc8c6b321ef9e3103960a0d699b6e3df12b428bebff"
    # value = "0"
    return mc.set(key, value, time, min_compress_len, noreply)
except Exception, e:
    traceback.print_exc()

can you help me to figure out what is happening?

EDIT:

value was a result from psycopg2, i converted to json and worked:

import json

value = json.loads(json.dumps(value))
...

Activity

  1. k1ltr0 commented on Jan 27, 2016

    @k1ltr0
    Author

    thank you myself from the past....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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