andymccurdy/redis-py — pull request #338 by stephan-hof (2013-04-17 13:31:36+00:00)
Title: socket gets corrupted if errors in pipeline happen

Hey the following code triggers this exception
```
TypeError: 'long' object is not iterable
```

```python
import redis
x = redis.Redis()
x.flushall()
x.config_set("maxmemory", 10*1024*1024)
try:
with x.pipeline(transaction=False) as pipe:
pipe.hmset('x', {'d1': 'v'})
pipe.hmset('x', {'d1': 'v' * 5*1024*1024})
pipe.expire('x', 100)
print pipe.execute()
except Exception as error:
pass

x.hgetall('x')
```

The problem is, that is soon as the second hmset fails with "OOM command not allowed when used memory > 'maxmemory'" the results for the 'expire' is *not* read.
It is stucked into the socket until another command is executed. In this case the hgetall gets the response of the expire command.

I changed '_execute_pipeline' to catch the 'ResponseError' so the client proceeds in reading data from the socket