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

potential bugs in _send_command and _read #7

Closed
awestendorf opened this issue Jan 21, 2010 · 3 comments
Closed

potential bugs in _send_command and _read #7

awestendorf opened this issue Jan 21, 2010 · 3 comments

Comments

@awestendorf
Copy link
Contributor

I was browsing the driver source in the course of reviewing Redis for work and found a few potential bugs in the socket code.

The _read() method is calling "return self._fp.readline()", but this is bypassing the code at the end of the method which should be checking to see if self._sock.recv()=='', so a disconnect will likely not be handled correctly. It seems that _get_response() might handle this correctly, but _get_value() will raise a ValueError instead of a ConnectionError.

In the _send_command() method, if an EPIPE is raised, it won't work across platforms because it's checking if the value is 32, and not errno.EPIPE. I've had trouble with this in the past, as Linux and OSX use different enumerations.

@andymccurdy
Copy link
Contributor

Thanks for finding this issue. It has been resolved in the "newapi" branch of redis-py. I plan on merging it into master in the next day or two, and then making an official release.

@andymccurdy
Copy link
Contributor

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

@awestendorf
Copy link
Contributor Author

Glad I could help. I was going to patch it in a branch but ran out of time. We're very interested in redis and will be using this driver when we get around to experimenting with it.

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

2 participants