djveremix / redis

Automatically exported from code.google.com/p/redis
0 stars 0 forks source link

r.keys() from redis-py v1.34.1 failing against redis 2.0.0-rc1 #260

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install the latest Redix (2.0 RC)
2. easy_install redis
3. from python:
    r = redis.Redis()
    r.keys('*')

What is the expected output? What do you see instead?
I think it should output []
Instead I see:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.macosx-10.5-i386/egg/redis/client.py", line 440, in keys
  File "build/bdist.macosx-10.5-i386/egg/redis/client.py", line 284, in format_inline
  File "build/bdist.macosx-10.5-i386/egg/redis/client.py", line 220, in execute_command
  File "build/bdist.macosx-10.5-i386/egg/redis/client.py", line 215, in _execute_command
  File "build/bdist.macosx-10.5-i386/egg/redis/client.py", line 269, in parse_response
  File "build/bdist.macosx-10.5-i386/egg/redis/client.py", line 181, in <lambda>
AttributeError: 'list' object has no attribute 'split'

What version of the product are you using? On what operating system?

ls ~/Library/Python/2.5/site-packages/redis-1.34.1-py2.5.egg
ls redis-2.0.0-rc1.tar.gz

Please provide any additional information below.

Line 181 in client.py shows;

            'KEYS' : lambda r: r and r.split(' ') or [],

So I suspect that 'r' is not a list and thus does not have split()
But I'm not sure what it should be.

Original issue reported on code.google.com by wjh...@gmail.com on 18 Jun 2010 at 2:58

GoogleCodeExporter commented 8 years ago
You should not "easy_install redis"
Use github version.

In pypi there is an ancient version.

Andy wanted to package new version soon there.

Also, the right place to file a bug about it is 
http://github.com/andymccurdy/redis-py/issues

Original comment by kmeren...@gmail.com on 18 Jun 2010 at 3:06

GoogleCodeExporter commented 8 years ago
Thanks, I keep meaning to upgrade past easy_install but have just been lazy!

Original comment by wjh...@gmail.com on 18 Jun 2010 at 3:24

GoogleCodeExporter commented 8 years ago
Just gave this a go and still having the same error...

easy_install -m redis
Downloaded the tarball from github and ran 'python setup.py install'

I deleted it from my site-packages (and confirmed I couldn't important it)
Then reinstalled from the github tarball and still got the error.

Original comment by wjh...@gmail.com on 18 Jun 2010 at 3:33

GoogleCodeExporter commented 8 years ago
You haven't deleted it it seems.

> 'KEYS' : lambda r: r and r.split(' ') or [],
There is no such code in latest redis-py version: 
http://github.com/andymccurdy/redis-py/blob/master/redis/client.py

Have you downloaded from http://github.com/andymccurdy/redis-py/tarball/master 
? If not, try it.

Original comment by kmeren...@gmail.com on 18 Jun 2010 at 3:39

GoogleCodeExporter commented 8 years ago
Hmm, strange. I downloaded the new version from here;

http://github.com/andymccurdy/redis-py/downloads

And looks like it has the 1.34.1 version.

Here I go again; 

1) rm -Rf Library/Python/2.5/site-packages/redis-1.34.1-py2.5.egg

2) $ echo "import redis" | python
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named redis
loki:redis wjhuie$ 

3) wget http://github.com/andymccurdy/redis-py/tarball/master

4) cd andy*

5) python setup.py install

6) $ python
Python 2.5.1 (r251:54863, Feb  6 2009, 19:02:12) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import redis
>>> r = redis.Redis()
>>> r.keys('*')
['mykey', 'log', 'mylist', 'myset', 'counter_rand000000000000', 'foo', 'key-1', 
'foo_rand000000000000', 'myhash']

*BINGO*

Just had a the wrong tarball!

Thanks!

Original comment by wjh...@gmail.com on 18 Jun 2010 at 3:59

GoogleCodeExporter commented 8 years ago

Original comment by anti...@gmail.com on 31 Aug 2010 at 11:10