Skip to content
New issue

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

problem setting a value #85

Open
k1ltr0 opened this issue Dec 15, 2015 · 1 comment
Open

problem setting a value #85

k1ltr0 opened this issue Dec 15, 2015 · 1 comment

Comments

@k1ltr0
Copy link

k1ltr0 commented Dec 15, 2015

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))
...
@k1ltr0
Copy link
Author

k1ltr0 commented Jan 27, 2016

thank you myself from the past....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant