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

Redis.keys: AttributeError: 'int' object has no attribute 'split' #2

Closed
richardhenry opened this issue Dec 23, 2009 · 5 comments
Closed

Comments

@richardhenry
Copy link

Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from redis import Redis, ConnectionError, ResponseError
>>> r = Redis(db=0)
>>> r.keys('*')
[]
>>> r.set(1, 'somevalue')
'OK'
>>> r.keys('*')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.macosx-10.6-universal/egg/redis.py", line 337, in keys
AttributeError: 'int' object has no attribute 'split'
@tnm
Copy link
Contributor

tnm commented Jan 8, 2010

Reproducible. Also occurs when the arg is given as a string:

>>> r.set('1', '10')
'OK'

>>> r.keys('*')

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.macosx-10.6-universal/egg/redis.py", line 345, in keys
  AttributeError: 'int' object has no attribute 'split'

@Bernie
Copy link

Bernie commented Feb 5, 2010

This is related to issue 8-- the problem is that the _get_value method decodes the response as an int and as such, the return value does not have the split method.

@Bernie
Copy link

Bernie commented Feb 5, 2010

I have fixed this issue in my redis-py fork by removing the automatic int and float conversions that the original client performed.

@andymccurdy
Copy link
Contributor

This issue has been resolved in the "newapi" branch of redis-py.

@andymccurdy
Copy link
Contributor

This issue has been resolved in the 1.34 release of redis-py.

bellatoris pushed a commit to bellatoris/redis-py that referenced this issue Jul 13, 2023
* [GROW-2938] add a test for invalid index returned from load balancer

* [GROW-2938] add a test for pipeline additional backoff

(cherry picked from commit 308c82b)
This issue was closed.
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

4 participants