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

Doesn't work for simple SET/GET #28

Closed
goxen opened this issue Apr 2, 2010 · 6 comments
Closed

Doesn't work for simple SET/GET #28

goxen opened this issue Apr 2, 2010 · 6 comments

Comments

@goxen
Copy link

goxen commented Apr 2, 2010

I can't get this to work AT ALL using your library. WinXpsp3 / python 2.6

I installed a redis server on a linux box. I can get set values on the server using its non-localhost IP. I get errors when attempting to use your library from a windows client.

This is the code I ran on the server

import redis
r=redis.Redis("10.41.19.4")
r.set("key","value")
'OK'
r.get("key")
u'value'

This is code I ran on the client after the above:

import redis
r=redis.Redis("10.41.19.4")
r.get("key")
Traceback (most recent call last):
File "", line 1, in
File "redis\client.py", line 497, in get
return self.execute_command('GET', name)
File "redis\client.py", line 296, in execute_command
*_options
File "redis\client.py", line 275, in _execute_command
self.connection.send(command, self)
File "redis\client.py", line 77, in send
self.connect(redis_instance)
File "redis\client.py", line 62, in connect
redis_instance._setup_connection()
File "redis\client.py", line 389, in _setup_connection
self.execute_command('SELECT', self.connection.db)
File "redis\client.py", line 296, in execute_command
*_options
File "redis\client.py", line 278, in _execute_command
return self.parse_response(command_name, **options)
File "redis\client.py", line 355, in parse_response
response = self._parse_response(command_name, catch_errors)
File "redis\client.py", line 315, in _parse_response
raise ResponseError(response)
redis.exceptions.ResponseError: unknown command

@andymccurdy
Copy link
Contributor

Interesting. I haven't tested on Windows. I'll try it on my desktop when I have a free moment.

@guileen
Copy link

guileen commented Apr 21, 2010

It is really not work at all .
Actually , it can't work for string.
Handled
* With an error message (the first byte of the reply will be "-")
* With a single line reply (the first byte of the reply will be "+)
* With bulk data (the first byte of the reply will be "$")
* With multi-bulk data, a list of values (the first byte of the reply will be "*")
* With an integer number (the first byte of the reply will be ":")
But the simple string is just response the string. error of Redis._parse_response

@andymccurdy
Copy link
Contributor

Can you post a stack trace of an error you're seeing?

@guileen
Copy link

guileen commented Apr 24, 2010

I test it again. It works for simple GET/SET. It is something else for me. I have create another issue to describe that problem.

It is fatal problem for multi-threads.

http://github.com/andymccurdy/redis-py/issues/#issue/34

@guileen
Copy link

guileen commented Apr 24, 2010

sorry , I was wrong. I should construct different redis object for each thread.

@andymccurdy
Copy link
Contributor

I can't reproduce this behavior with threaded Redis. Please re-open and post a stack trace if you continue to see these problems.

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

3 participants