title: Error in Celery: TypeError("can_read() got an unexpected keyword argument 'timeout'",)
body: <p>I am trying to integrate celery to my django application.</p>
  
  <p>I am following the tutorial provided here <a href="https://realpython.com/blog/python/asynchronous-tasks-with-django-and-celery/" rel="nofollow noreferrer">Real Python : Asynchronous Tasks</a></p>
  
  <p>When I try to execute the following code:</p>
  
  <pre><code> celery -A app_name worker -l info
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>[2017-07-12 22:43:16,118: CRITICAL/MainProcess] Unrecoverable error: 
  
  TypeError("can_read() got an unexpected keyword argument 'timeout'",)
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/celery/worker/worker.py", line 203, in start
      self.blueprint.start(self)
    File "/usr/local/lib/python2.7/dist-packages/celery/bootsteps.py", line 119, in start
      step.start(parent)
    File "/usr/local/lib/python2.7/dist-packages/celery/bootsteps.py", line 370, in start
      return self.obj.start()
    File "/usr/local/lib/python2.7/dist-packages/celery/worker/consumer/consumer.py", line 318, in start
      blueprint.start(self)
    File "/usr/local/lib/python2.7/dist-packages/celery/bootsteps.py", line 119, in start
      step.start(parent)
    File "/usr/local/lib/python2.7/dist-packages/celery/worker/consumer/consumer.py", line 594, in start
      c.loop(*c.loop_args())
    File "/usr/local/lib/python2.7/dist-packages/celery/worker/loops.py", line 88, in asynloop
      next(loop)
    File "/usr/local/lib/python2.7/dist-packages/kombu/async/hub.py", line 345, in create_loop
      cb(*cbargs)
    File "/usr/local/lib/python2.7/dist-packages/kombu/transport/redis.py", line 1039, in on_readable
      self.cycle.on_readable(fileno)
    File "/usr/local/lib/python2.7/dist-packages/kombu/transport/redis.py", line 337, in on_readable
      chan.handlers[type]()
    File "/usr/local/lib/python2.7/dist-packages/kombu/transport/redis.py", line 671, in _receive
      while c.connection.can_read(timeout=0):
  TypeError: can_read() got an unexpected keyword argument 'timeout'
  </code></pre>
  
  <p>I am using celery version v4.0.2</p>
  
  <p>What is the reason behind the error and how do I solve it?</p>